mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-21 10:42:33 +00:00
feat: add extract reasoning middleware (#6463)
This commit is contained in:
parent
585378cba0
commit
8f629db988
1 changed files with 10 additions and 1 deletions
|
|
@ -1,6 +1,14 @@
|
|||
import { Provider } from "@/provider/provider"
|
||||
import { Log } from "@/util/log"
|
||||
import { streamText, wrapLanguageModel, type ModelMessage, type StreamTextResult, type Tool, type ToolSet } from "ai"
|
||||
import {
|
||||
streamText,
|
||||
wrapLanguageModel,
|
||||
type ModelMessage,
|
||||
type StreamTextResult,
|
||||
type Tool,
|
||||
type ToolSet,
|
||||
extractReasoningMiddleware,
|
||||
} from "ai"
|
||||
import { clone, mergeDeep, pipe } from "remeda"
|
||||
import { ProviderTransform } from "@/provider/transform"
|
||||
import { Config } from "@/config/config"
|
||||
|
|
@ -183,6 +191,7 @@ export namespace LLM {
|
|||
return args.params
|
||||
},
|
||||
},
|
||||
extractReasoningMiddleware({ tagName: "think", startWithReasoning: false }),
|
||||
],
|
||||
}),
|
||||
experimental_telemetry: { isEnabled: cfg.experimental?.openTelemetry },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue