Core concepts

Deploying Your Bricks

After the process of building and testing your Bricks, you're now ready to deploy your project. This step will generate an URL and a PROJECT_ID for you to access your Bricks.


Deploy Your Bricks

You can initiate the deployment process by clicking the 'Deploy' button from within the Bricks Builder.

Always test before deploying!

Ensure that your Bricks are functioning as expected by thoroughly testing them before deployment. This can save you from potential issues and hassles down the line.

Below, you'll find examples of how to call your deployed Brick using cURL and JavaScript's fetch method:

with cURL,

curl --location <URL> \
--header 'Content-Type: application/json' \
--data '{"project_id":"<PROJECT_ID>", "messages":[{"role":"user", "content":"What'\''s the current weather in Los angeles?"}]}'

And using JavaScript's fetch method,

var raw = JSON.stringify({
  "project_id": "<PROJECT_ID>",
  "messages": [
    {
      "role": "user",
      "content": "What's the current weather in Los angeles?"
    }
  ]
});

var requestOptions = {
  method: 'POST',
  body: raw,
};

fetch("<URL>", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

If you have enabled the AllowStreaming option in your Bricks settings, you can choose between /chatCompletion and /chatCompletionStreamed to receive your answer in a streamed format.

For more detailed information on how to utilize your newly deployed Bricks, please check out the Integration Section.

Previous
Test Your Bricks