This is a beta feature according to Algolia’s Terms of Service (“Beta Services”).
- C#
- Dart
- Go
- Java
- JavaScript
- Kotlin
- PHP
- Python
- Ruby
- Scala
- Swift
The Agent Studio API client is part of the To use the Agent Studio client, import these namespaces:To create an instance of the client:
Algolia.Search package.
To install this package, run:Command line
dotnet add package Algolia.Search
C#
using Algolia.Search.Clients;
using Algolia.Search.Http;
using Algolia.Search.Models.AgentStudio;
C#
var client = new AgentStudioClient(
new AgentStudioConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);
The Agent Studio API client is part of the To use the Agent Studio API client, add this import to your files:To create an instance of the client:
algoliasearch package.
To install this package, run:Command line
dart pub add algoliasearch
Dart
import 'package:algolia_client_agent_studio/algolia_client_agent_studio.dart';
Dart
final client = AgentStudioClient(
appId: 'ALGOLIA_APPLICATION_ID',
apiKey: 'ALGOLIA_API_KEY'
);
The Agent Studio API client is part of the To use the Agent Studio client, add this import to your files:To create an instance of the client:
algoliasearch-client-go package.
To install it, run:Command line
go get github.com/algolia/algoliasearch-client-go
Go
import agentStudio "github.com/algolia/algoliasearch-client-go/v4/algolia/agent-studio"
Go
client, err := agentStudio.NewClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
if err != nil {
// The client can fail to initialize if you pass an invalid parameter.
panic(err)
}
The Agent Studio API client is part of the or to your To use the Agent Studio client, add these imports to your files:To create an instance of the client:
algoliasearch package.
You can add this package to your pom.xml file for Maven:pom.xml
<dependency>
<groupId>com.algolia</groupId>
<artifactId>algoliasearch</artifactId>
<version>4.25.0</version>
</dependency>
build.gradle file for Gradle:build.gradle
implementation 'com.algolia:algoliasearch:4.25.0'
Java
import com.algolia.api.AgentStudioClient;
import com.algolia.config.*;
Java
AgentStudioClient client = new AgentStudioClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");
The Agent Studio API client is part of the To use this client, run:
@algolia/agent-studio package.
To install it, run:Command line
npm install @algolia/agent-studio
JavaScript
import { agentStudioClient } from "@algolia/agent-studio";
const client = agentStudioClient(
"ALGOLIA_APPLICATION_ID",
"ALGOLIA_API_KEY",
);
The Agent Studio API client is part of the To use the Agent Studio client, add this import to your files:To create an instance of the client:
algoliasearch-client-kotlin package.
You can add this package to your build.gradle.kts file:build.gradle.kts
implementation("com.algolia:algoliasearch-client-kotlin:3.28.0")
// You also need to add a KTOR engine as dependency, for example:
implementation("io.ktor:ktor-client-java:$ktor_version")
Kotlin
import com.algolia.client.api.AgentStudioClient
import com.algolia.client.configuration.*
import com.algolia.client.transport.*
Kotlin
val client = AgentStudioClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
The Agent Studio API client is part of the To use the Agent Studio client, add this import to your files:To create an instance of the client:
algoliasearch-client-php package.
To install this package, run:Command line
composer require algolia/algoliasearch-client-php
PHP
use Algolia\AlgoliaSearch\Api\AgentStudioClient;
PHP
$client = AgentStudioClient::create('ALGOLIA_APPLICATION_ID', 'ALGOLIA_API_KEY');
The Agent Studio API client is part of the To use the Agent Studio client, add this import to your files:To create an instance of the client:The client supports the The method names are the same for synchronous and asynchronous methods.
algoliasearch package.
You can install this package with pip:Command line
pip install 'algoliasearch>=4,<5'
Python
from algoliasearch.agent_studio.client import AgentStudioClientSync
from json import loads
Python
# In an asynchronous context, you can use AgentStudioClient instead, which exposes the exact same methods.
client = AgentStudioClientSync("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
Async code
To use the Agent Studio client in async environments, add these imports instead:Python
import asyncio
from algoliasearch.agent_studio.client import AgentStudioClient
async with statement to automatically close open connections.Python
async def run():
async with AgentStudioClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY") as client:
# client.create_agent_completion(...)
The Agent Studio API client is part of the To use the Agent Studio client, add this import to your files:To create an instance of the client:
algolia gem.
To install this gem, run:Command line
gem install algolia
Ruby
require "algolia"
Ruby
client = Algolia::AgentStudioClient.create("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
The Agent Studio API client is part of the To use the Agent Studio client, add these imports to your files:To create an instance of the client:
algoliasearch-scala package.
You can add this package to your build.sbt file:build.sbt
// For Scala 3:
libraryDependencies += "com.algolia" %% "algoliasearch-scala_3" % "2.27.0"
// For Scala 2:
libraryDependencies += "com.algolia" %% "algoliasearch-scala_2" % "2.27.0"
Scala
import algoliasearch.api.AgentStudioClient
import algoliasearch.config.*
Scala
val client = AgentStudioClient(appId = "ALGOLIA_APPLICATION_ID", apiKey = "ALGOLIA_API_KEY")
The Agent Studio API client is part of the To use the Agent Studio client, add this import to your files:To create an instance of the client:
algoliasearch-client-swift package.
You can add this package to your Package.swift file:Package.swift
// swift-tools-version: 5.10
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Algolia API clients",
platforms: [
.macOS(.v11)
],
dependencies: [
.package(
url: "https://github.com/algolia/algoliasearch-client-swift.git", from: "9.28.0")
],
targets: [
.executableTarget(
name: "Algolia API clients",
dependencies: [
.product(name: "AgentStudio", package: "algoliasearch-client-swift")
]
)
]
)
Swift
import AgentStudio
Swift
let client = try AgentStudioClient(appID: "ALGOLIA_APPLICATION_ID", apiKey: "ALGOLIA_API_KEY")
Streaming
The Agent Studio API client supports streaming completions in JavaScript and Python. Other languages only support non-streaming completions for now. For more information, see Create Completion.Helper methods
The Agent Studio API client includes helper methods to simplify common tasks.Not all helper methods are available for all API clients and their implementation might differ.