-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add additional LLM provider options to be used #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e3fea9b
fd6804f
15d342b
6e5e737
6a6e3b0
01b65a5
dbfcc06
8e85134
db6b243
497ffcf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,3 +32,4 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json | |
|
|
||
| # Finder (MacOS) folder config | ||
| .DS_Store | ||
| qdrant_storage/ | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ import { stepCountIs, ToolLoopAgent, type ToolSet } from "ai" | |
| import { z } from "zod" | ||
| import type { Blackboard } from "../blackboard" | ||
| import type { SessionSummary } from "../blackboard/types" | ||
| import { config } from "../config" | ||
| import type { RuntimeConfig } from "../config" | ||
| import { createBlackboardTools } from "../tools/blackboard" | ||
| import type { CodebaseTools } from "../tools/codebase" | ||
| import type { DocTools } from "../tools/docs" | ||
|
|
@@ -121,6 +121,7 @@ export function createOrchestratorAgent( | |
| codebaseTools: Partial<CodebaseTools> | ||
| interactionTools: InteractionTools | ||
| }, | ||
| runtimeConfig: RuntimeConfig, | ||
| ) { | ||
| const systemPrompt = buildSystemPrompt(context) | ||
|
|
||
|
|
@@ -147,10 +148,27 @@ export function createOrchestratorAgent( | |
| ...blackboardTools, | ||
| } | ||
|
|
||
| const researchAgent = createResearchAgent(blackboard, researchTools) | ||
| const plannerAgent = createPlannerAgent(blackboard, plannerTools) | ||
| const writerAgent = createWriterAgent(blackboard, writerTools) | ||
| const userAgent = createUserAgent(blackboard, userTools) | ||
| // Create sub-agents with injected config | ||
| const researchAgent = createResearchAgent(blackboard, researchTools, { | ||
| maxRetries: runtimeConfig.agents.runtime.research.maxRetries, | ||
| model: runtimeConfig.models.fast, | ||
| providerOptions: runtimeConfig.agents.runtime.research.providerOptions, | ||
| }) | ||
| const plannerAgent = createPlannerAgent(blackboard, plannerTools, { | ||
| maxRetries: runtimeConfig.agents.runtime.planner.maxRetries, | ||
| model: runtimeConfig.models.fast, | ||
| providerOptions: runtimeConfig.agents.runtime.planner.providerOptions, | ||
| }) | ||
| const writerAgent = createWriterAgent(blackboard, writerTools, { | ||
| maxRetries: runtimeConfig.agents.runtime.writer.maxRetries, | ||
| model: runtimeConfig.models.prose, | ||
| providerOptions: runtimeConfig.agents.runtime.writer.providerOptions, | ||
| }) | ||
| const userAgent = createUserAgent(blackboard, userTools, { | ||
| maxRetries: runtimeConfig.agents.runtime.userInteraction.maxRetries, | ||
| model: runtimeConfig.models.fast, | ||
| providerOptions: runtimeConfig.agents.runtime.userInteraction.providerOptions, | ||
| }) | ||
|
Comment on lines
+151
to
+171
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Aqua-123 i'm assuming we should now specify provider options via docbot.config.json? same for fallback models? (which used to be both hardcoded in config.ts)
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the flow of user config being loaded is that
{
"providers": [
{
"type": "openai-compatible",
"name": "lmstudio", // ← this becomes the provider prefix
"baseURL": "http://localhost:1234/v1"
}
],
"models": {
"planning": "lmstudio/loaded-model", // ← "lmstudio" + "loaded-model"
"prose": "lmstudio/loaded-model",
...
}
}
registerProviders(configs) {
if (configs.length > 0) {
this.useGateway = false // ← switches OFF gateway mode
}
for (const config of configs) {
if (config.type === "openai-compatible") {
this.registerOpenAICompatible(config) // ← registers "lmstudio" → factory
}
}
}
getModel(modelId: string) {
const providerName = "lmstudio" // parsed from "lmstudio/loaded-model"
const modelName = "loaded-model"
// 1. Check custom providers first ← MATCHES HERE
if (this.customProviders.has("lmstudio")) {
return this.customProviders.get("lmstudio")!("loaded-model")
}
// 2. Native overrides (openai, anthropic, etc. with custom keys)
// 3. Gateway mode (default, but disabled when providers are configured)
// 4. Default native providers (uses env vars)
// 5. Error if unknown
}
createOpenAICompatible({
name: "lmstudio",
baseURL: "http://localhost:1234/v1",
apiKey: config.apiKey, // optional
})So what is not taken as proper config input is
Now we can determine which of these we want to add these configurable or not |
||
|
|
||
| const orchestratorTools = { | ||
| ...createWorkflowTools(), | ||
|
|
@@ -408,12 +426,12 @@ export function createOrchestratorAgent( | |
| }, | ||
| } | ||
|
|
||
| const runtime = config.agents.runtime.orchestrator | ||
| const runtime = runtimeConfig.agents.runtime.orchestrator | ||
|
|
||
| const agent = new ToolLoopAgent({ | ||
| instructions: systemPrompt, | ||
| maxRetries: runtime.maxRetries, | ||
| model: config.models.planning, | ||
| model: runtimeConfig.models.planning, | ||
|
|
||
| prepareStep: ({ messages }) => { | ||
| // inject current session state at every step so the orchestrator | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Inconsistent example: the
nanomodel referencesgoogle/gemini-3-flashbut theprovidersarray only includesopenaiandanthropic. Users following this example will get errors. Either add{ "type": "google" }to providers, or change nano to use an openai/anthropic model.Prompt for AI agents