feat: 转发thinking的内容

This commit is contained in:
ikechan8370 2025-01-30 00:36:58 +08:00
parent 5e4d921002
commit 3cd664ff53
3 changed files with 72 additions and 131 deletions

View file

@ -2,6 +2,7 @@ import Keyv from 'keyv'
export type Role = 'user' | 'assistant' | 'system' | 'function'
import fetch from 'node-fetch'
export type FetchFn = typeof fetch
export type ChatGPTAPIOptions = {
@ -67,6 +68,7 @@ export type SendMessageBrowserOptions = {
export interface ChatMessage {
id: string
text: string
thinking_text?: string
role: Role
name?: string
delta?: string
@ -204,6 +206,7 @@ export namespace openai {
delta: {
role: Role
content?: string,
reasoning_content?: string,
function_call?: FunctionCall,
tool_calls: ToolCall[]
}