File tree Expand file tree Collapse file tree 1 file changed +0
-43
lines changed Expand file tree Collapse file tree 1 file changed +0
-43
lines changed Original file line number Diff line number Diff line change 1- import { Anthropic } from "@anthropic-ai/sdk"
21import { type MinimaxModelId , minimaxDefaultModelId , minimaxModels } from "@roo-code/types"
32
43import type { ApiHandlerOptions } from "../../shared/api"
5- import { XmlMatcher } from "../../utils/xml-matcher"
6- import { ApiStream } from "../transform/stream"
7- import type { ApiHandlerCreateMessageMetadata } from "../index"
84
95import { BaseOpenAiCompatibleProvider } from "./base-openai-compatible-provider"
106
@@ -20,43 +16,4 @@ export class MiniMaxHandler extends BaseOpenAiCompatibleProvider<MinimaxModelId>
2016 defaultTemperature : 1.0 ,
2117 } )
2218 }
23-
24- override async * createMessage (
25- systemPrompt : string ,
26- messages : Anthropic . Messages . MessageParam [ ] ,
27- metadata ?: ApiHandlerCreateMessageMetadata ,
28- ) : ApiStream {
29- const stream = await this . createStream ( systemPrompt , messages , metadata )
30-
31- const matcher = new XmlMatcher (
32- "think" ,
33- ( chunk ) =>
34- ( {
35- type : chunk . matched ? "reasoning" : "text" ,
36- text : chunk . data ,
37- } ) as const ,
38- )
39-
40- for await ( const chunk of stream ) {
41- const delta = chunk . choices [ 0 ] ?. delta
42-
43- if ( delta ?. content ) {
44- for ( const matcherChunk of matcher . update ( delta . content ) ) {
45- yield matcherChunk
46- }
47- }
48-
49- if ( chunk . usage ) {
50- yield {
51- type : "usage" ,
52- inputTokens : chunk . usage . prompt_tokens || 0 ,
53- outputTokens : chunk . usage . completion_tokens || 0 ,
54- }
55- }
56- }
57-
58- for ( const chunk of matcher . final ( ) ) {
59- yield chunk
60- }
61- }
6219}
You can’t perform that action at this time.
0 commit comments