#TypeError: Completions.create() got an unexpected keyword argument 'api_type'

11 messages · Page 1 of 1 (latest)

dull ore
#

I am trying to run autogen using my own server (runpod), but I am getting the following error:

TypeError: Completions.create() got an unexpected keyword argument 'api_type'

It seems to me that the error is coming from openai, but I am not sure.

I'm using pyautogen~=0.2.0b5

Here is my code:

config_list = [{
    "model": "llama-7B",
    "base_url": "https://xxxxxxx.proxy.runpod.net/v1",
    "api_type": "open_ai",
    "api_key": "sk-111111111111111111111111111111111111111111111111"
}]
llm_config = {
    "seed": 42,
    "config_list": config_list,
    "temperature": 0
}

assistant = autogen.AssistantAgent(
    name="assistant",
    llm_config=llm_config,
    is_termination_msg=lambda x: True if "TERMINATE" in x.get(
        "content") else False,
)

user_proxy = autogen.UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
    is_termination_msg=lambda x: True if "TERMINATE" in x.get(
        "content") else False,
    max_consecutive_auto_reply=10,
    code_execution_config={
        "work_dir": "work_dir",
        "use_docker": False,
    },
)

task1 = """
Find arxiv papers that show how are people studying trust calibration in AI based systems 
"""

user_proxy.initiate_chat(assistant, message=task1)

I don't know why this is happening. Is anyone else having this issue?

violet yacht
#

In your config list, openai models don't need the api_type key. It's only used for azure openai models. Does that help?

dull ore
#

I see, but I'm trying to use my own server on runpod.io with the same API format as OpenAI. so, I'm passing the base_url to direct it to my server.

violet yacht
#

I'm not familiar with runpod.io. What happens if you remove api_type?

dull ore
violet yacht
#

Searching this discord for runpod turns up a few users working with runpod. Hopefully one of them can say whether they encountered a similar problem, or how they avoided it.

dull ore
#

OK, I am also trying to debug the autogen code to try to understand what I am doing wrong. 🙂 Thank you!

dull ore
#

I checked the parameters that autogen sends to the server and made a direct request using Insomnia. I noticed that my server is responding with an empty "content": "". I'm not sure why yet, but it's a good clue to finding a solution.

snow ember
#

I was using Runpod and the OpenAi Api's it was working fine.

I did something and broke it and get the same error was well

TypeError: Completions.create() got an unexpected keyword argument 'request_timeout'

The error comes up whether using RunPod or the OpenAI apis

violet yacht
snow ember
#

Yep , thank you I had found the answer here as well. https://github.com/microsoft/autogen/issues/730

and I got it working with the OpenAI API.

On Runpod I still get the following error

TypeError: Completions.create() got an unexpected keyword argument 'api_base'

"api_base" : "https://cb5lf-5000.proxy.runpod.net/v1",

Like the api_base is the link to the runpod port. How am I supposed to have it work ?