Closed billdoors closed 2 weeks ago
Facing the same issue.
Appears to be related to https://github.com/microsoft/autogen/pull/3210/commits/f0548409eb7d55c762369df0e308289d8a68fe1a where the aws_session_token
was removed from required_keys
. It's not optional if you're working with session access to AWS Bedrock (eg. for developing/testing code locally). It should get added to openai_config
if it's not None
.
@Varun2101 you are right. If I create an IAM user and provide the aws_access_key and aws_secret_key, it works.
How do we make Autogen work with Bedrock? I am trying the following code with a Mistral model:
from autogen import AssistantAgent, UserProxyAgent
from dotenv import load_dotenv
import os
load_dotenv()
config_list = [
{
"model": "mistral.mixtral-8x7b-instruct-v0:1",
"aws_access_key":os.getenv('aws_access_key_id'),
"aws_secret_key":os.getenv('aws_secret_access_key'),
"aws_region":"us-west-2",
"aws_session_token":"none",
"api_type": "mistral",
"api_key": "none"
}
]
assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
# Create a UserProxyAgent that can execute code
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"use_docker": False})
# Initiate a chat between the user proxy and the assistant
message = f'''<s>[INST]
Enter your prompt here
[/INST]'''
user_proxy.initiate_chat(assistant, message=message)
It gives me the following error:
MistralAPIException: Status: 401. Message: {
"message":"Unauthorized",
"request_id":"02fb534ea9da864a9db3646dbc4cf16b"
}
As of now, it supports only anthropic.
Bedrock client is being added to Autogen through #3232 .
@billdoors This was fixed. Please close this if you are good.
Describe the bug
https://github.com/microsoft/autogen/pull/3210
Steps to reproduce
2.
I got error message: PermissionDeniedError: Error code: 403 - {'message': 'The security token included in the request is invalid.'}
Model Used
No response
Expected Behavior
No response
Screenshots and logs
No response
Additional Information
No response