-
Notifications
You must be signed in to change notification settings - Fork 170
Fix variable scope error and add get_info endpoint #46
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?
Fix variable scope error and add get_info endpoint #46
Conversation
- Add imports for PromptAgentInputToolsItem_System, SystemToolConfigInputParams_TransferToAgent, and AgentTransfer - Modify create_conversation_config to accept tools parameter instead of hardcoding end_call tool - Update create_agent function to support transfer_rules parameter - Create transfer_to_agent tool configuration when transfer rules are provided - Include transfer rules information in agent creation response message
…ation - New MCP tool that takes an agent_id and returns the full conversation_config - Returns configuration in formatted JSON for easy inspection - Useful for debugging and understanding agent settings including tools, prompts, and voice configuration
…ration - New function that properly handles the built_in_tools object structure - Supports enabling/disabling transfer_to_agent, language_detection, and end_call tools - Updates both the built_in_tools object and the tools array to maintain consistency - Properly sets unused tools to null in built_in_tools as per API requirements
- Convert frozen conversation config to dict before modification - Use create_conversation_config to build new config object - Ensures compatibility with Pydantic's frozen model instances - Add CLAUDE.md with project documentation for development guidance 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The function was referencing the 'file' variable outside its scope when determining the KnowledgeBaseLocator type. Added 'is_file_based' boolean to track whether the knowledge base is file-based or URL-based. Fixes: UnboundLocalError: cannot access local variable 'file' where it is not associated with a value 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
New MCP tool that provides information about the ElevenLabs MCP server: - Project location on disk - Package root directory - Version information - Base path configuration - API key status 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
|
||
| # Extract current conversation config and convert to dict | ||
| current_config = agent.conversation_config | ||
| config_dict = current_config.model_dump() if hasattr(current_config, 'model_dump') else current_config.__dict__ |
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.
this is a pydantic base model, please remove the hasattr and call model dump directly
| Base Path (ELEVENLABS_MCP_BASE_PATH): {base_path or 'Not set (using Desktop)'} | ||
| API Key Configured: {'Yes' if api_key else 'No'}""" | ||
|
|
||
| return TextContent(type="text", text=info) |
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.
i dont see how this is useful/desirable, please remove or explain why its needed
| max_duration_seconds: int = 300, | ||
| record_voice: bool = True, | ||
| retention_days: int = 730, | ||
| transfer_rules: list[dict] | None = None, |
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.
i like this! just wondering if we should do this for each system tool? seems weird to do it for only a single one...
| "prompt": system_prompt, | ||
| "llm": llm, | ||
| "tools": [{"type": "system", "name": "end_call", "description": ""}], | ||
| "tools": tools if tools is not None else [{"type": "system", "name": "end_call", "description": ""}], |
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.
nice! thanks for catching this!
| @@ -0,0 +1,110 @@ | |||
| # CLAUDE.md | |||
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.
could we add a note here to avoid using hasattr()
seems this agentic coding added a few calls to it we should avoid
|
thanks for the contribution! left a few comments |
|
Thanks for fixing this! I can confirm this bug affects URL-based knowledge bases in real-world usage. Test Case ValidationI encountered the exact same add_knowledge_base_to_agent(
agent_id="agent_01k0qsr0q4ez0advwkf2hwfc8q",
knowledge_base_name="Website Knowledge",
url="https://youradv.com/"
)Error: Confirmed Behavior
This fix will enable URL scraping for agent knowledge bases, which is a really valuable feature for dynamic content integration. Looking forward to this being merged! 🎉 |
|
@amovfx are you able to make the requested changes here? |
Summary
add_knowledge_base_to_agentfunctionget_infoMCP tool to return project location and configuration detailsChanges
UnboundLocalErrorinadd_knowledge_base_to_agentwhere thefilevariable was referenced outside its scopeget_infoendpoint that returns project location, version, base path, and API key statusTest plan
add_knowledge_base_to_agentwith URL parameteradd_knowledge_base_to_agentwith file parameteradd_knowledge_base_to_agentwith text parameterget_infoendpoint returns correct project information🤖 Generated with Claude Code