@@ -17,37 +17,33 @@ The chatCompletions feature is experimental and must be enabled through [experim
1717
1818``` json
1919{
20- "workspace" : " customer-support" ,
21- "createdAt" : " 2024-01-15T09:30:00Z" ,
22- "updatedAt" : " 2024-01-15T14:45:00Z"
20+ "uid" : " customer-support"
2321}
2422```
2523
26- | Name | Type | Description |
27- | :--------------- | :----- | :---------------------------------------------------------------------------------------------- |
28- | ** ` workspace ` ** | String | Unique identifier for the chatCompletions workspace |
29- | ** ` createdAt ` ** | String | Creation date of the workspace, represented in [ RFC 3339] ( https://www.ietf.org/rfc/rfc3339.txt ) format |
30- | ** ` updatedAt ` ** | String | Latest update date of the workspace, represented in [ RFC 3339] ( https://www.ietf.org/rfc/rfc3339.txt ) format |
24+ | Name | Type | Description |
25+ | :---------- | :----- | :-------------------------------------------------- |
26+ | ** ` uid ` ** | String | Unique identifier for the chatCompletions workspace |
3127
3228## ChatCompletions settings object
3329
3430``` json
3531{
36- "provider" : " openai" ,
37- "model" : " gpt-3.5-turbo" ,
32+ "source" : " openAi" ,
3833 "apiKey" : " sk-..." ,
3934 "baseUrl" : " https://api.openai.com/v1" ,
40- "prompt" : " You are a helpful assistant that answers questions based on the provided context."
35+ "prompts" : {
36+ "system" : " You are a helpful assistant that answers questions based on the provided context."
37+ }
4138}
4239```
4340
4441| Name | Type | Description |
4542| :------------- | :----- | :------------------------------------------------------------------------------------ |
46- | ** ` provider ` ** | String | LLM provider: ` "openai" ` , ` "azure_openai" ` , ` "mistral" ` , ` "gemini" ` , or ` "vllm" ` |
47- | ** ` model ` ** | String | Model identifier (e.g., ` "gpt-3.5-turbo" ` ) |
48- | ** ` apiKey ` ** | String | API key for the LLM provider (write-only, optional for vLLM) |
49- | ** ` baseUrl ` ** | String | Base URL for the provider (required for Azure OpenAI and vLLM) |
50- | ** ` prompt ` ** | String | System prompt to guide the assistant's behavior |
43+ | ** ` source ` ** | String | LLM source: ` "openAi" ` , ` "azureOpenAi" ` , ` "mistral" ` , ` "gemini" ` , or ` "vllm" ` |
44+ | ** ` apiKey ` ** | String | API key for the LLM provider (write-only, optional for vllm) |
45+ | ** ` baseUrl ` ** | String | Base URL for the provider (required for azureOpenAi and vllm) |
46+ | ** ` prompts ` ** | Object | Prompts object containing system prompts and other configuration |
5147
5248## Chat completions
5349
@@ -179,10 +175,11 @@ Configure the LLM provider and settings for a chat workspace.
179175
180176``` json
181177{
182- "provider" : " openai" ,
183- "model" : " gpt-3.5-turbo" ,
178+ "source" : " openAi" ,
184179 "apiKey" : " sk-..." ,
185- "prompt" : " You are a helpful assistant."
180+ "prompts" : {
181+ "system" : " You are a helpful assistant."
182+ }
186183}
187184```
188185
@@ -196,69 +193,74 @@ Returns the updated settings object. Note that `apiKey` is write-only and will n
196193
197194<CodeGroup >
198195
199- ``` bash OpenAI
196+ ``` bash openAi
200197curl \
201198 -X PUT ' http://localhost:7700/chats/customer-support/settings' \
202199 -H ' Authorization: Bearer MASTER_KEY' \
203200 -H ' Content-Type: application/json' \
204201 --data-binary ' {
205- "provider": "openai",
206- "model": "gpt-4",
202+ "source": "openAi",
207203 "apiKey": "sk-...",
208- "prompt": "You are a helpful customer support assistant."
204+ "prompts": {
205+ "system": "You are a helpful customer support assistant."
206+ }
209207 }'
210208```
211209
212- ``` bash "Azure OpenAI"
210+ ``` bash azureOpenAi
213211curl \
214212 -X PUT ' http://localhost:7700/chats/customer-support/settings' \
215213 -H ' Authorization: Bearer MASTER_KEY' \
216214 -H ' Content-Type: application/json' \
217215 --data-binary ' {
218- "provider": "azure_openai",
219- "model": "gpt-4",
216+ "source": "azureOpenAi",
220217 "apiKey": "your-azure-api-key",
221218 "baseUrl": "https://your-resource.openai.azure.com",
222- "prompt": "You are a helpful customer support assistant."
219+ "prompts": {
220+ "system": "You are a helpful customer support assistant."
221+ }
223222 }'
224223```
225224
226- ``` bash Mistral
225+ ``` bash mistral
227226curl \
228227 -X PUT ' http://localhost:7700/chats/customer-support/settings' \
229228 -H ' Authorization: Bearer MASTER_KEY' \
230229 -H ' Content-Type: application/json' \
231230 --data-binary ' {
232- "provider": "mistral",
233- "model": "mistral-large-latest",
231+ "source": "mistral",
234232 "apiKey": "your-mistral-api-key",
235- "prompt": "You are a helpful customer support assistant."
233+ "prompts": {
234+ "system": "You are a helpful customer support assistant."
235+ }
236236 }'
237237```
238238
239- ``` bash Gemini
239+ ``` bash gemini
240240curl \
241241 -X PUT ' http://localhost:7700/chats/customer-support/settings' \
242242 -H ' Authorization: Bearer MASTER_KEY' \
243243 -H ' Content-Type: application/json' \
244244 --data-binary ' {
245- "provider": "gemini",
246- "model": "gemini-1.5-pro",
245+ "source": "gemini",
247246 "apiKey": "your-gemini-api-key",
248- "prompt": "You are a helpful customer support assistant."
247+ "prompts": {
248+ "system": "You are a helpful customer support assistant."
249+ }
249250 }'
250251```
251252
252- ``` bash vLLM
253+ ``` bash vllm
253254curl \
254255 -X PUT ' http://localhost:7700/chats/customer-support/settings' \
255256 -H ' Authorization: Bearer MASTER_KEY' \
256257 -H ' Content-Type: application/json' \
257258 --data-binary ' {
258- "provider": "vllm",
259- "model": "llama-3-8b",
259+ "source": "vllm",
260260 "baseUrl": "http://your-vllm-server:8000",
261- "prompt": "You are a helpful customer support assistant."
261+ "prompts": {
262+ "system": "You are a helpful customer support assistant."
263+ }
262264 }'
263265```
264266
@@ -282,9 +284,10 @@ Returns the settings object without the `apiKey` field.
282284
283285``` json
284286{
285- "provider" : " openai" ,
286- "model" : " gpt-3.5-turbo" ,
287- "prompt" : " You are a helpful assistant."
287+ "source" : " openAi" ,
288+ "prompts" : {
289+ "system" : " You are a helpful assistant."
290+ }
288291}
289292```
290293
@@ -340,14 +343,10 @@ curl \
340343{
341344 "results" : [
342345 {
343- "workspace" : " customer-support" ,
344- "createdAt" : " 2024-01-15T09:30:00Z" ,
345- "updatedAt" : " 2024-01-15T14:45:00Z"
346+ "uid" : " customer-support"
346347 },
347348 {
348- "workspace" : " internal-docs" ,
349- "createdAt" : " 2024-01-16T10:00:00Z" ,
350- "updatedAt" : " 2024-01-16T10:00:00Z"
349+ "uid" : " internal-docs"
351350 }
352351 ],
353352 "offset" : 0 ,
0 commit comments