Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Getting "KeyError('messages')" when calling agent completions HTTP API #3413

Open
1 task done
ddallabenetta opened this issue Nov 14, 2024 · 2 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@ddallabenetta
Copy link

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch name

main

Commit ID

df9d054

Other environment information

No response

Actual behavior

Can't use agents via api, since the completions api always return the following error:
Screenshot 2024-11-14 alle 14 26 48

By looking at the session.py code, I noticed that the session gets created with a 'message' field instead of a'messages' one. This may be the reason of the issue.

Expected behavior

Generate response from agent via HTTP API

Steps to reproduce

1. Create an agent
2. Call the HTTP request via POST /api/v1/agents/{agentId}/completions with the following body

{
    "stream": true,
    "question": "Hello?"
}


### Additional information

_No response_
@ddallabenetta ddallabenetta added the bug Something isn't working label Nov 14, 2024
@KevinHuSh
Copy link
Collaborator

Which LLM do you use?

@ddallabenetta
Copy link
Author

I am using OpenAI gpt 4o mini. The api key is set and it’s working through the agent run web ui

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants