mcp-client-cli icon indicating copy to clipboard operation
mcp-client-cli copied to clipboard

azure_openai config sample

Open anotheronebitesthedusttttz opened this issue 1 year ago • 0 comments

Do you have a config sample for LLM on azure_openai?

I tried with something like:

  "llm": {
    "provider": "azure_openai",
    "model": "Phi-4",
    "api_version": "2024-05-01-preview",
    "api_key": "redacted",
    "temperature": 0.3,
    "azure_endpoint": "https://redacted.services.ai.azure.com/models/"
  },

but when I run the tool I get:

pydantic_core._pydantic_core.ValidationError: 1 validation error for AzureChatOpenAI
  Value error, Must provide either the `api_version` argument or the `OPENAI_API_VERSION` environment variable [type=value_error, input_value={'model': 'Phi-4', 'api_k... {}, 'model_kwargs': {}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/value_error

If I run by specifying OPENAI_API_VERSION as the env var, OPENAI_API_VERSION=2024-05-01-preview llm "text", I get:

pydantic_core._pydantic_core.ValidationError: 1 validation error for AzureChatOpenAI
  Value error, Must provide one of the `base_url` or `azure_endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable [type=value_error, input_value={'model': 'Phi-4', 'api_k... {}, 'model_kwargs': {}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/value_error

If I run with OPENAI_API_VERSION=2024-05-01-preview AZURE_OPENAI_ENDPOINT=https://redacted.services.ai.azure.com llm "text", I get:

  File ".venv/lib/python3.12/site-packages/mcp_client_cli/cli.py", line 234, in handle_conversation
    agent_executor = create_react_agent(
                     ^^^^^^^^^^^^^^^^^^^
TypeError: create_react_agent() got an unexpected keyword argument 'state_modifier'