Skip to content

Commit 709c8b4

Browse files
committed
docs: add useComplitionApi option for OpenAI-compatible providers in agent modes
1 parent 81cea89 commit 709c8b4

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

adminforth/documentation/docs/tutorial/05-Adapters/05-ai-completion-adapters.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,25 @@ new CompletionAdapterOpenAIResponses({
134134
openAiApiKey: process.env.OVH_AI_ENDPOINTS_ACCESS_TOKEN as string,
135135
baseUrl: 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1',
136136
model: 'gpt-oss-20b',
137+
useComplitionApi: true,
137138
extraRequestBodyParameters: {
138139
store: false,
139140
},
140141
}),
141142
```
142143

144+
For LangChain agent mode, `useComplitionApi` controls which provider API is used:
145+
146+
- `false` uses the OpenAI `responses` API
147+
- `true` uses the Chat Completions API
148+
149+
If `useComplitionApi` is omitted, the adapter keeps the current default behavior:
150+
151+
- official OpenAI uses the `responses` API
152+
- custom `baseUrl` providers use the Chat Completions API
153+
154+
OVH AI Endpoints still does not fully support the `responses` API, so `useComplitionApi: false` may work unstably there.
155+
143156

144157

145158
## Google Gemini Completion Adapter
@@ -179,4 +192,4 @@ new CompletionAdapterGoogleGemini({
179192
responseMimeType: 'application/json',
180193
},
181194
}),
182-
```
195+
```

adminforth/documentation/docs/tutorial/08-Plugins/26-agent.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,19 @@ plugins: [
278278
]
279279
```
280280

281+
When using OpenAI-compatible providers for agent modes, you can force Chat Completions API mode with `useComplitionApi: true`:
282+
283+
```ts
284+
completionAdapter: new CompletionAdapterOpenAIResponses({
285+
openAiApiKey: process.env.OVH_AI_ENDPOINTS_ACCESS_TOKEN as string,
286+
baseUrl: 'https://oai.endpoints.kepler.ai.cloud.ovh.net/v1',
287+
model: 'gpt-oss-20b',
288+
useComplitionApi: true,
289+
})
290+
```
291+
292+
OVH AI Endpoints still does not fully support the OpenAI `responses` API, so `useComplitionApi: false` may work unstably there.
293+
281294
Each item in `modes` defines a user-selectable preset in the chat UI. The selected mode is sent to the backend and the plugin uses that mode's `completionAdapter` for the response.
282295

283296
The plugin adds a chat surface to the admin UI, keeps session history per admin user, and shows a mode picker when `modes` are configured.

0 commit comments

Comments
 (0)