mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 07:03:25 +00:00
refactor(ai): Add completion signal to onText/onThinking callbacks
- Update LLMOptions interface to include completion boolean parameter - Modify all providers to signal when text/thinking blocks are complete - Update examples to handle the completion parameter - Move documentation files to docs/ directory
This commit is contained in:
parent
a42c54e6fe
commit
cb4c32faaa
11 changed files with 45 additions and 13 deletions
|
|
@ -24,8 +24,8 @@ const tools: Tool[] = [
|
|||
];
|
||||
|
||||
const options: AnthropicLLMOptions = {
|
||||
onText: (t) => process.stdout.write(t),
|
||||
onThinking: (t) => process.stdout.write(chalk.dim(t)),
|
||||
onText: (t, complete) => process.stdout.write(t + (complete ? "\n" : "")),
|
||||
onThinking: (t, complete) => process.stdout.write(chalk.dim(t + (complete ? "\n" : ""))),
|
||||
thinking: { enabled: true }
|
||||
};
|
||||
const ai = new AnthropicLLM("claude-sonnet-4-0", process.env.ANTHROPIC_OAUTH_TOKEN ?? process.env.ANTHROPIC_API_KEY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue