microsoft / TaskWeaver

A code-first agent framework for seamlessly planning and executing data analytics tasks.

Home Page:https://microsoft.github.io/TaskWeaver/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

openrouter {'message': 'Missing Authentication header or invalid API key', 'code': 401}}

HuggingTech opened this issue · comments

"I'm using openrouter to access gpt-4, configuring the taskweaver_config.json file with the settings as shown in the figure, but I keep getting this error message every time I ask a question."

{
"llm.api_base": "https://openrouter.ai/api/v1",
"llm.api_key": "sk-0r-v1-3760747aa4803dfla7b0f3da07e104210d1c.......................................",
"llm.model": "openai/gpt-4o"
}

image

Haven't tested this endpoint before. Could you firstly try if you can access the endpoint using a simple script with the openai module? then, we can rule out the possibilities of any configuration errors.

Haven't tested this endpoint before. Could you firstly try if you can access the endpoint using a simple script with the openai module? then, we can rule out the possibilities of any configuration errors.

"We use Docker images and pass OpenRouter parameters through environment variables, which works fine. Currently, we are running the code from the main branch, and the same parameters are causing the above error."

"I also encounter the same error when running the LLM_API_test unit test."

"I rewrote an independent test and connected to OpenRouter, which was successful. However, I could not connect using TaskWeaver, possibly due to a defect in the TaskWeaver code, and the reason has not yet been identified."

image

I just registered and try a random query with the following configurations:

  "llm.api_base": "https://openrouter.ai/api/v1",
  "llm.api_key": "sk-or-v1-2bb53d5f2774e4e4a6d....",
  "llm.model": "openchat/openchat-7b",

Everything went well. I got the following output:

 TaskWeaver ▶  I am TaskWeaver, an AI assistant. To get started, could you please enter your request?
    Human   ▶  Hi
 ╭───< Planner >askWeaver] preparing          <=�=>
 ├─► [init_plan] 1. Respond to the user's greeting    <=�=>      
 ├─► [plan] 1. Respond to the user's greeting      <=�=>     
 ├─► [current_plan_step] 1. Respond to the user's greetinghe u         <=�=> 
 ├──● Hello, what can I help you?o, what can    <=�=>        
 ├─► [board]
 │   I have drawn up a plan: 
 │   1. Respond to the user's greeting
 │   
 │   Please proceed with this step of this plan: Hello, what can I help you?
 ╰──● sending message to User
 TaskWeaver ▶  Hello, what can I help you?

So, I'm not sure what is the problem in your case.

Haven't tested this endpoint before. Could you firstly try if you can access the endpoint using a simple script with the openai module? then, we can rule out the possibilities of any configuration errors.

"We use Docker images and pass OpenRouter parameters through environment variables, which works fine. Currently, we are running the code from the main branch, and the same parameters are causing the above error."

I had same problem with openrouter key, befor running well and then reached error as above