Returns a reference to the specified AI agent. If no ID is provided, the built-in agent is used by default.
Retrieves an AI audio client.
Executes an AI-powered API call using a specific integration. The AI will select appropriate endpoints, generate request bodies, and analyze responses to answer the provided prompt.
The API integration to use
Natural language description of what to accomplish
Optionaloptions: AiAgentApiIntegrationOptionsOptional configuration including allowed endpoints and verbose updates
OptionalsessionContext: AiSessionContextOptional session context for audit trails and tracing
Promise resolving to the API call result with answer and execution details
Executes an AI query using a specific DB integration, sending a prompt to the AI and returning its response. This function allows for direct interaction with the AI's capabilities by sending text prompts and receiving the AI's responses, which can be used for various applications such as automating tasks, generating content, or obtaining information.
The identifier for the DB integration which is used to direct the query to the appropriate DB.
The text prompt to send to the AI. This should be formulated in a way that the AI can understand and respond to, taking into account the nature of the task or the information sought.
Optionaloptions: AiQueryOptionsAdditional options to customize the query execution.
A promise that resolves to an ExecuteAiQueryResponse. This response includes the AI's
reply to the provided prompt, along with any other relevant information that is part of
the AI's response. The promise can be awaited to handle the response asynchronously.
const response = await squid.ai().executeAiQuery(myDbIntegrationId, "How many transactions ran yesterday?");
console.log(response);
Can be used with an API key or using a security rule with @secureAiQuery() decorator.
For more details on the usage and capabilities of the AI Assistant, refer to the documentation provided at https://docs.squid.cloud/docs/ai.
Creates a client to manage files for a specific AI provider.
The AI provider (openai, gemini, or anthropic).
An AiFilesClient bound to the specified provider.
Returns name of the secret that stores API key for the given AI provider type. This API key is used for all requests to the AI provider done from the application.
Retrieves an AI image client.
Returns a reference to the specified AI knowledge base.
Lists all available AI agents.
Lists all available AI agents.
Retrieves an AI match-making client.
Sets the name of the secret that stores API key for the given AI provider type. This API key is used for all requests to the AI provider done from the application. To delete the existing secret key use 'undefined' for the name of the secret. Returns the updated state of the AI application settings.
Sets new application AI settings. Overwrites the existing value.
AiClient class serves as a facade for interacting with different AI services. It provides simplified access to AI chatbot and assistant functionalities through its methods.