feat: switch default engine to claude_api with base URL support
- Change AGENT_ENGINE_TYPE from claude_code_cli to claude_api in docker-compose - Add ANTHROPIC_BASE_URL env var support to claude-api-engine - Add ANTHROPIC_BASE_URL to agent-service environment in docker-compose Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9a1ecf10ec
commit
810dcd7def
|
|
@ -126,7 +126,8 @@ services:
|
||||||
- DB_DATABASE=${POSTGRES_DB:-it0}
|
- DB_DATABASE=${POSTGRES_DB:-it0}
|
||||||
- REDIS_URL=redis://redis:6379
|
- REDIS_URL=redis://redis:6379
|
||||||
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
|
||||||
- AGENT_ENGINE_TYPE=claude_code_cli
|
- ANTHROPIC_BASE_URL=${ANTHROPIC_BASE_URL}
|
||||||
|
- AGENT_ENGINE_TYPE=claude_api
|
||||||
- AGENT_SERVICE_PORT=3002
|
- AGENT_SERVICE_PORT=3002
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3002/',r=>{process.exit(r.statusCode<500?0:1)}).on('error',()=>process.exit(1))\""]
|
test: ["CMD-SHELL", "node -e \"require('http').get('http://localhost:3002/',r=>{process.exit(r.statusCode<500?0:1)}).on('error',()=>process.exit(1))\""]
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ export class ClaudeApiEngine implements AgentEnginePort {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const client = new Anthropic({ apiKey });
|
const baseURL = this.configService.get<string>('ANTHROPIC_BASE_URL');
|
||||||
|
const client = new Anthropic({ apiKey, ...(baseURL ? { baseURL } : {}) });
|
||||||
|
|
||||||
const abortController = new AbortController();
|
const abortController = new AbortController();
|
||||||
this.abortControllers.set(params.sessionId, abortController);
|
this.abortControllers.set(params.sessionId, abortController);
|
||||||
|
|
@ -228,7 +229,8 @@ export class ClaudeApiEngine implements AgentEnginePort {
|
||||||
const apiKey = this.configService.get<string>('ANTHROPIC_API_KEY');
|
const apiKey = this.configService.get<string>('ANTHROPIC_API_KEY');
|
||||||
if (!apiKey) return false;
|
if (!apiKey) return false;
|
||||||
|
|
||||||
const client = new Anthropic({ apiKey });
|
const baseURL = this.configService.get<string>('ANTHROPIC_BASE_URL');
|
||||||
|
const client = new Anthropic({ apiKey, ...(baseURL ? { baseURL } : {}) });
|
||||||
|
|
||||||
// Make a minimal API call to verify connectivity
|
// Make a minimal API call to verify connectivity
|
||||||
const response = await client.messages.create({
|
const response = await client.messages.create({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue