Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Set this Boolean property to true to indicate that you want the model API to stream its output as it is generated rather than sending the output all at once. Beware that some model API may not have this capability.

OpenAI Models

To setup an OpenAI model, you will need an API key. Follow these steps to create the key:

  1. Go to the OpenAI website.

  2. Click Sign Up or Sign In in the top-right corner. You may need to provide payment details for API usage. See OpenAI pricing for details.

  3. Go the API keys section.

  4. Create a new secret key (you can provide an identifiable secret key name, such as “Profound AI Key”).

  5. Copy the secret key (it generally starts with “sk-”), and paste it into your config.js file assigning it to the “apiKey” property.

Google Models

To setup a model from Google, visit https://ai.google.dev/ and select Get API key.

Copy the API key into into your config.js file assigning it to the “apiKey” property.

Prior to using models from Google, you must install the following prerequisites:

  • Node.js v18+

  • GoogleGenerativeAI package - use command below to install:

Code Block
languagebash
npm install @google/generative-ai

Azure Cognitive Services (Azure OpenAI)

To work with models through the Azure OpenAI service, follow these steps:

  1. Go to https://portal.azure.com and sign in.

  2. Search and select the Azure OpenAI service.

  3. Click Create a resource and follow the steps to create the resource.

  4. Go to the resource you created and select Keys and Endpoint.

    1. Copy those items into your config.js file as endpoint and apiKey properties of your model.

    2. Alternatively, instead of the endpoint property, you can also set the resource property based on the resource name you chose. With this property set, the endpoint will be constructed automatically.

    3. Set the provider property to “azure”.

  5. Go to Manage Deployments.

  6. Select Create Deployment.

  7. Select desired model and model version; then give it a name. Supply this name as the model property in your config.js file. Ensure the model and version you select supports function calling. It may take a few minutes before the model is fully deployed and you are ready to try it.

Anthropic Models

Use the Anthropic Console online to generate an API key and copy it into your config.js file assigning it to the “apiKey” property.

Prior to using models from Anthropic, use the command below to install the Anthropic SDK npm package:

Code Block
languagebash
npm install @anthropic-ai/sdk