Tool Confirmation API Integration
Backend API Call Structure
When users confirm tools in the ToolConfirmation component, the following parameters are now added to the API request:
New Parameters Added to emissaryConfig
// When user confirms tools
emissaryConfig: {
// ... existing config ...
confirm_past_pause: true,
tools_to_use: [
{
'name': 'vertex_search',
'config': [
{'parameter': 'query', 'value': 'renewable energy market conditions UK'},
{'parameter': 'query', 'value': 'renewable energy market conditions Iberia'}
]
},
{
'name': 'extract_files',
'config': [
{'parameter': 'path', 'value': '/documents'}
]
}
]
}
// When user skips/rejects tools
emissaryConfig: {
// ... existing config ...
// confirm_past_pause and tools_to_use are omitted
}
API Request Flow
-
User receives tool confirmation prompt from backend:
<toolconfirmation tools_to_use='[...]' /> -
User modifies and confirms tools in the React component
- Next API call includes the confirmed tools in
emissaryConfig:confirm_past_pause: true- tells backend user confirmed a previous pausetools_to_use: FirstImpressionTool[]- the actual confirmed/modified tools
- Backend receives these parameters and can:
- Skip the tool selection phase
- Use the user-confirmed tools directly
- Continue processing with approved tool configuration
Data Flow Path
ToolConfirmation Component
↓ (user confirms)
Emissary.tsx → handleBotMessage()
↓
chatStreaming.ts → handleMessageStreaming()
↓
vacChat.ts → emissaryConfigForApi
↓
/api/proxy → backend
↓
backend/vac_service.py (receives confirm_past_pause & tools_to_use)
Example Usage
// In future implementation, when user confirms tools:
const confirmedTools = [
{
name: 'vertex_search',
config: [
{ parameter: 'query', value: 'modified search query' }
]
}
];
// This will be passed to the next API call
const streamingConfig = {
// ... other config ...
confirm_past_pause: true,
tools_to_use: confirmedTools
};
Current Status
✅ API structure ready - Backend now receives confirm_past_pause and tools_to_use parameters
🔄 Next step - Implement mechanism to bubble up confirmed tools from ToolConfirmation component to API call
🔄 Next step - Connect user confirmation actions to trigger new API requests with confirmed tools