DeepCode icon indicating copy to clipboard operation
DeepCode copied to clipboard

[Question]:Support for AzureOpenAI or custom open AI provider?

Open ahmedmustahid opened this issue 4 months ago β€’ 1 comments

Do you need to ask a question?

  • [x] I have searched the existing question and discussions and this question is not already answered.
  • [x] I believe this is a legitimate question, not just a bug or feature request.

Your Question

In the mcp_agent.secrets.yaml I am using

azure:
 api_key: "my api key"
 endpoint: "azure endpoint"
 api_version: "2025-01-01-preview"

But I have been facing error (full log below):

❌ run_research_analyzer failed: 1 validation error for RequestCompletionRequest
config
  Input should be a valid dictionary or instance of OpenAISettings [type=model_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.11/v/model_type
Exception details: ValidationError: 1 validation error for RequestCompletionRequest

It seems to me that this error occurs because I have been using AzureOpenAi. Could any make sure if this assumption is correct? If so how can I integrate AzureOpenAI into the code?

Same applies to custom open ai compatible provider such as kimi K2 by Moonshot AI.

Additional Context

πŸš€ Initializing Agent Orchestration Engine... βœ“
[22:59:16] βœ… 🧠 Agent Orchestration Engine initialized successfully
[22:59:16] ⏳ πŸš€ Starting comprehensive agent orchestration pipeline...

πŸ“‹ COMPREHENSIVE PIPELINE STATUS
───────────────────────────────────────────────────────────────────────────────
πŸš€ Initialize   β”‚ Setting up AI engine      β”‚ ⏳ IN PROGRESS
πŸ“Š Analyze      β”‚ Analyzing research content β”‚ ⏸️  PENDING
πŸ“₯ Download     β”‚ Processing document       β”‚ ⏸️  PENDING
πŸ“‹ Plan         β”‚ Generating code architecture β”‚ ⏸️  PENDING
πŸ” References   β”‚ Analyzing references      β”‚ ⏸️  PENDING
πŸ“¦ Repos        β”‚ Downloading repositories  β”‚ ⏸️  PENDING
πŸ—‚οΈ Index        β”‚ Building code index       β”‚ ⏸️  PENDING
βš™οΈ Implement    β”‚ Implementing code         β”‚ ⏸️  PENDING
───────────────────────────────────────────────────────────────────────────────

πŸ“‹ COMPREHENSIVE PIPELINE STATUS
───────────────────────────────────────────────────────────────────────────────
πŸš€ Initialize   β”‚ Setting up AI engine      β”‚ βœ“ COMPLETED
πŸ“Š Analyze      β”‚ Analyzing research content β”‚ ⏳ IN PROGRESS
πŸ“₯ Download     β”‚ Processing document       β”‚ ⏸️  PENDING
πŸ“‹ Plan         β”‚ Generating code architecture β”‚ ⏸️  PENDING
πŸ” References   β”‚ Analyzing references      β”‚ ⏸️  PENDING
πŸ“¦ Repos        β”‚ Downloading repositories  β”‚ ⏸️  PENDING
πŸ—‚οΈ Index        β”‚ Building code index       β”‚ ⏸️  PENDING
βš™οΈ Implement    β”‚ Implementing code         β”‚ ⏸️  PENDING
───────────────────────────────────────────────────────────────────────────────
[22:59:16] ⏳ πŸ”„ Setting up workspace for file processing...
πŸš€ Initializing intelligent multi-agent research orchestration system
πŸ“ Working environment: local
πŸ“‚ Workspace directory: /Users/ahmed/work/my_projects/prompt_tuning/DeepCode/deepcode_lab
βœ… Workspace status: ready
🧠 Advanced intelligence analysis enabled - comprehensive workflow

πŸ“‹ COMPREHENSIVE PIPELINE STATUS
───────────────────────────────────────────────────────────────────────────────
πŸš€ Initialize   β”‚ Setting up AI engine      β”‚ βœ“ COMPLETED
πŸ“Š Analyze      β”‚ Analyzing research content β”‚ ⏳ IN PROGRESS
πŸ“₯ Download     β”‚ Processing document       β”‚ ⏸️  PENDING
πŸ“‹ Plan         β”‚ Generating code architecture β”‚ ⏸️  PENDING
πŸ” References   β”‚ Analyzing references      β”‚ ⏸️  PENDING
πŸ“¦ Repos        β”‚ Downloading repositories  β”‚ ⏸️  PENDING
πŸ—‚οΈ Index        β”‚ Building code index       β”‚ ⏸️  PENDING
βš™οΈ Implement    β”‚ Implementing code         β”‚ ⏸️  PENDING
───────────────────────────────────────────────────────────────────────────────
[22:59:16] ⏳ πŸ“Š Analyzing research content and extracting key information...
πŸ“Š Starting research analysis...
Input prompt length: 56
Input preview: /Users/ahmed/work/papers/contextEngr/promptEvolution.pdf...
πŸ” Using search server: web-search-mcp
[INFO] 2025-07-28T22:58:59 mcp_agent.core.context - Configuring logger with level: info
[INFO] 2025-07-28T22:58:59 mcp_agent.cli_agent_orchestration - MCPApp initialized
{
  "data": {
    "progress_action": "Running",
    "target": "cli_agent_orchestration",
    "agent_name": "mcp_application_loop",
    "session_id": "57a353be-821a-450c-88e3-10305a75dc9c"
  }
}
[INFO] 2025-07-28T22:59:16 mcp_agent.core.context - Configuring logger with level: info
[INFO] 2025-07-28T22:59:16 mcp_agent.cli_agent_orchestration - MCPApp initialized
{
  "data": {
    "progress_action": "Running",
    "target": "cli_agent_orchestration",
    "agent_name": "mcp_application_loop",
    "session_id": "2249ef04-94fd-40c3-903e-4f1c433c10bc"
  }
}
[INFO] 2025-07-28T22:59:16 mcp_agent.cli_agent_orchestration - MCPApp cleanup
{
  "data": {
    "progress_action": "Finished",
    "target": "cli_agent_orchestration",
    "agent_name": "mcp_application_loop"
  }
}
[INFO] 2025-07-28T22:59:16 mcp_agent.mcp.mcp_connection_manager - web-search-mcp: Up and running with a persistent connection!
analyzer: Connected to server, calling list_tools...
Tools available: {'meta': None, 'nextCursor': None, 'tools': [{'name': 'web-search-mcp_full-web-search', 'title': None, 'description': 'Search the web and fetch complete page content from top results. This is
the most comprehensive web search tool. It searches the web and then follows the resulting links to extract their full page content, providing the most detailed and complete information available. Use
get-web-search-summaries for a lightweight alternative.', 'inputSchema': {'type': 'object', 'properties': {'query': {'type': 'string', 'description': 'Search query to execute (recommended for comprehensive
research)'}, 'limit': {'type': ['number', 'string'], 'default': 5, 'description': 'Number of results to return with full content (1-10)'}, 'includeContent': {'type': ['boolean', 'string'], 'default': True,
'description': 'Whether to fetch full page content (default: true)'}, 'maxContentLength': {'type': ['number', 'string'], 'description': 'Maximum characters per result content (0 = no limit). Usually not needed
- content length is automatically optimized.'}}, 'required': ['query'], 'additionalProperties': False, '$schema': 'http://json-schema.org/draft-07/schema#'}, 'outputSchema': None, 'annotations': None, 'meta':
None}, {'name': 'web-search-mcp_get-web-search-summaries', 'title': None, 'description': 'Search the web and return only the search result snippets/descriptions without following links to extract full page
content. This is a lightweight alternative to full-web-search for when you only need brief search results. For comprehensive information, use full-web-search instead.', 'inputSchema': {'type': 'object',
'properties': {'query': {'type': 'string', 'description': 'Search query to execute (lightweight alternative)'}, 'limit': {'type': ['number', 'string'], 'default': 5, 'description': 'Number of search results to
return (1-10)'}}, 'required': ['query'], 'additionalProperties': False, '$schema': 'http://json-schema.org/draft-07/schema#'}, 'outputSchema': None, 'annotations': None, 'meta': None}, {'name':
'web-search-mcp_get-single-web-page-content', 'title': None, 'description': 'Extract and return the full content from a single web page URL. This tool follows a provided URL and extracts the main page content.
Useful for getting detailed content from a specific webpage without performing a search.', 'inputSchema': {'type': 'object', 'properties': {'url': {'type': 'string', 'format': 'uri', 'description': 'The URL of
the web page to extract content from'}, 'maxContentLength': {'type': ['number', 'string'], 'description': 'Maximum characters for the extracted content (0 = no limit, undefined = use default limit). Usually not
needed - content length is automatically optimized.'}}, 'required': ['url'], 'additionalProperties': False, '$schema': 'http://json-schema.org/draft-07/schema#'}, 'outputSchema': None, 'annotations': None,
'meta': None}]}
βœ… LLM attached successfully
πŸ”„ Making LLM request with params: max_tokens=6144, temperature=0.3
❌ LLM generation failed: 1 validation error for RequestCompletionRequest
config
  Input should be a valid dictionary or instance of OpenAISettings [type=model_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.11/v/model_type
Exception type: <class 'pydantic_core._pydantic_core.ValidationError'>
[INFO] 2025-07-28T22:59:16 mcp_agent.mcp.mcp_aggregator.ResearchAnalyzerAgent - Last aggregator closing, shutting down all persistent connections...

[INFO] 2025-07-28T22:59:16 mcp_agent.mcp.mcp_connection_manager - Disconnecting all persistent server connections...
[INFO] 2025-07-28T22:59:16 mcp_agent.mcp.mcp_connection_manager - web-search-mcp: Requesting shutdown...
[INFO] 2025-07-28T22:59:16 mcp_agent.mcp.mcp_connection_manager - All persistent server connections signaled to disconnect.
[INFO] 2025-07-28T22:59:16 mcp_agent.mcp.mcp_connection_manager - Disconnecting all persistent server connections...
❌ run_research_analyzer failed: 1 validation error for RequestCompletionRequest
config
  Input should be a valid dictionary or instance of OpenAISettings [type=model_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.11/v/model_type
Exception details: ValidationError: 1 validation error for RequestCompletionRequest

ahmedmustahid avatar Jul 28 '25 14:07 ahmedmustahid

Thank you for your interest. We found that this may involve modifications to the mcp-agent package. We will consider adding this support after completing the new feature implementation and dataset testing.

LZH-YS1998 avatar Aug 23 '25 15:08 LZH-YS1998