mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
支持 OpenAI Chat 兼容协议 (#99)
* feat: 完成 openai 接口兼容 * feat: 完成 openai 协议兼容 * fix: 修复测试用例
This commit is contained in:
@@ -1301,6 +1301,15 @@ async function* queryModel(
|
||||
API_MAX_MEDIA_PER_REQUEST,
|
||||
)
|
||||
|
||||
// OpenAI-compatible provider: delegate to the OpenAI adapter layer
|
||||
// after shared preprocessing (message normalization, tool filtering,
|
||||
// media stripping) but before Anthropic-specific logic (betas, thinking, caching).
|
||||
if (getAPIProvider() === 'openai') {
|
||||
const { queryModelOpenAI } = await import('./openai/index.js')
|
||||
yield* queryModelOpenAI(messagesForAPI, systemPrompt, filteredTools, signal, options)
|
||||
return
|
||||
}
|
||||
|
||||
// Instrumentation: Track message count after normalization
|
||||
logEvent('tengu_api_after_normalize', {
|
||||
postNormalizedMessageCount: messagesForAPI.length,
|
||||
|
||||
Reference in New Issue
Block a user