Skip to content

Not able to connect AzureOpenAI using custom agent's configuration LLMConfig in Autogen Studio #4694

Closed
@amd-srijaroy

Description

@amd-srijaroy

What happened?

Hi,

I am trying to connect to llm by passing custom config_list to create a assistant in Autogen Studio but in vain. I can connect to the LLM through Autogen python code. Below is the Agent Code I uploaded in the AutoGenStudio.

{
"user_id":"guestuser@gmail.com",
"version":"0.0.1",
"type":"assistant",
"config":{
"name":"default_assistant",
"human_input_mode":"NEVER",
"max_consecutive_auto_reply":25,
"system_message":"You are a helpful AI assistant.\nSolve tasks using your coding and language skills.\nIn the following cases, suggest python code (in a python coding block) or shell script (in a sh coding block) for the user to execute.\n 1. When you need to collect info, use the code to output the info you need, for example, get the current date/time, check the operating system. After sufficient info is printed and the task is ready to be solved based on your language skill, you can solve the task by yourself.\n 2. When you need to perform some task with code, use the code to perform the task and output the result. Finish the task smartly.\nSolve the task step by step if you need to. If a plan is not provided, explain your plan first. Be clear which step uses code, and which step uses your language skill.\nWhen using code, you must indicate the script type in the code block. The user cannot provide any other feedback or perform any other action beyond executing the code you suggest. The user can't modify your code. So do not suggest incomplete code which requires users to modify. Don't use a code block if it's not intended to be executed by the user.\nIf you want the user to save the code in a file before executing it, put # filename: inside the code block as the first line. Don't include multiple code blocks in one response. Do not ask users to copy and paste the result. Instead, use 'print' function for the output when relevant. Check the execution result returned by the user.\nIf the result indicates there is an error, fix the error and output the code again. Suggest the full code instead of partial code or code changes. If the error can't be fixed or if the task is not solved even after the code is executed successfully, analyze the problem, revisit your assumption, collect additional info you need, and think of a different approach to try.\nWhen you find an answer, verify the answer carefully. Include verifiable evidence in your response if possible.\nReply "TERMINATE" in the end when everything is done.\n ",
"is_termination_msg":null,
"code_execution_config":"none",
"default_auto_reply":"",
"description":"Assistant Agent",
"llm_config":{
"config_list":[
{
"model" : "",
"azure_deployment" : "<azure_deployment>",
"api_key": "",
"azure_ad_token": "<azure_ad_token>",
"base_url" : "<base_url>",
"api_type" : "<api_type>",
"api_version" : "<api_version>",
"default_headers": {"Ocp-Apim-Subscription-Key": ""},
"seed": 42,
}
],
"temperature":0,
"cache_seed":null,
"timeout":null,
"max_tokens":2048,
"extra_body":null
},
"admin_name":"Admin",
"messages":[
],
"max_round":100,
"speaker_selection_method":"auto",
"allow_repeat_speaker":true
},
"task_instruction":null
}

The error I am receiving is "Error occurred while processing message: Error code: 401 - {'statusCode': 401, 'message': 'Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.'}"

What did you expect to happen?

Work seamlessly as connecting to AzureOpenAI

How can we reproduce it (as minimally and precisely as possible)?

Create a new Agent with the code provided and try to run it (pass key through default_headers)

AutoGen version

0.2

Which package was this bug in

AutoGen Studio

Model used

gpt4o-mini

Python version

3.11

Operating system

Windows

Any additional info you think would be helpful for fixing this bug

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.2Issues which are related to the pre 0.4 codebase

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions