diff --git a/client-html/index.html b/client-html/index.html index ca7c412..2e92ce9 100644 --- a/client-html/index.html +++ b/client-html/index.html @@ -30,7 +30,7 @@

📡 Agent Connection

+ value="http://localhost:3000/">
💡 Enter only the base URL. The agent path (/a2a/buyer or /a2a/seller) will be added automatically. @@ -58,7 +58,7 @@

💬 Chat

Quick Actions:

- +
diff --git a/client/index.html b/client/index.html index b210a0e..c3c51ba 100644 --- a/client/index.html +++ b/client/index.html @@ -28,7 +28,7 @@

📡 Agent Connection

- +
@@ -54,7 +54,7 @@

💬 Chat

Quick Actions:

- +
diff --git a/client/src/app.js b/client/src/app.js index 8fa6aba..ad777b2 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -176,7 +176,7 @@ class A2ASDKClient { }; // Send using official SDK client.sendMessage() - const response = await this.client.sendMessage(message); + const response = await this.client.sendMessage({ message }); this.log('info', `📨 Response received from SDK`); console.log('Full SDK response:', response); diff --git a/server/src/a2a/executor.ts b/server/src/a2a/executor.ts index c48343b..1606c2e 100644 --- a/server/src/a2a/executor.ts +++ b/server/src/a2a/executor.ts @@ -10,6 +10,17 @@ import type { Message } from '@a2a-js/sdk'; import type { MCPServer } from '../mcp/mcp-server.js'; import type { MCPTool } from '../types/index.js'; +const DEFAULT_OPENAI_MODEL = 'gpt-4o-mini'; +const DEFAULT_OPENAI_REQUEST_CONFIG = { + temperature: 0.3 +}; + +const OPENAI_MODEL_REQUEST_CONFIG: Record> = { + 'gpt-5': { temperature: 1 }, + 'gpt-5-mini': { temperature: 1 }, + 'gpt-5-nano': { temperature: 1 } +}; + export class AgentExecutor implements IAgentExecutor { private openai: OpenAI; private mcpServer: MCPServer; @@ -201,14 +212,20 @@ If the request requires only ONE tool, respond with this JSON format: Always return valid JSON.`; + const model = process.env.OPENAI_MODEL || DEFAULT_OPENAI_MODEL; + const modelConfig = { + ...DEFAULT_OPENAI_REQUEST_CONFIG, + ...OPENAI_MODEL_REQUEST_CONFIG[model] + }; + const response = await this.openai.chat.completions.create({ - model: process.env.OPENAI_MODEL || 'gpt-4o-mini', + model, messages: [ { role: 'system', content: systemPrompt }, { role: 'user', content: userMessage } ], response_format: { type: 'json_object' }, - temperature: 0.3 + ...modelConfig }); const content = response.choices[0]?.message?.content;