🐛 fix: fix xAI API calling, not support stream_options (#7353)

* 🐛 fix: fix xAI API calling, not support `stream_options`

* 🐛 fix: try to fix ci error
This commit is contained in:
Zhijie He
2025-04-09 21:59:16 +08:00
committed by GitHub
parent c9f451762c
commit cc0680d645
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -10,4 +10,8 @@ testProvider({
defaultBaseURL: 'https://api.x.ai/v1',
chatDebugEnv: 'DEBUG_XAI_CHAT_COMPLETION',
chatModel: 'grok',
test: {
skipAPICall: true,
},
});
+4
View File
@@ -9,6 +9,10 @@ export interface XAIModelCard {
export const LobeXAI = LobeOpenAICompatibleFactory({
baseURL: 'https://api.x.ai/v1',
chatCompletion: {
// xAI API does not support stream_options: { include_usage: true }
excludeUsage: true,
},
debug: {
chatCompletion: () => process.env.DEBUG_XAI_CHAT_COMPLETION === '1',
},