Maplemx / Agently

[AI Agent Application Development Framework] - 🚀 Build AI agent native application in very few code 💬 Easy to interact with AI agent in code using structure data and chained-calls syntax 🧩 Enhance AI Agent using plugins instead of rebuild a whole new agent
http://agently.tech
Apache License 2.0
908 stars 100 forks source link

Report OpenAI Error when call AzureOpenAI service #111

Closed ghost closed 2 weeks ago

ghost commented 2 weeks ago

under debug model

[Request] OpenAI Error: {'id': '', 'choices': [], 'created': 0, 'model': '', 'object': '', 'system_fingerprint': None, 'usage': None, 'prompt_filter_results': [{'prompt_index': 0, 'content_filter_results': {'hate': {'filtered': False, 'severity': 'safe'}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': False, 'severity': 'safe'}}}]}

Maplemx commented 2 weeks ago

This is a confirmed bug caused by Agently OpenAI response message handling methods.

In current handling logic, we try to find first item in choices from response message and if we can not find any, we assume this message is an error message.

But when requesting AzureOpenAI, this kind of messages are normal response messages sent when requests are complete.

We will fix this bug in next version.

Maplemx commented 2 weeks ago

We made some changes in https://github.com/Maplemx/Agently/pull/114/commits/0835e21fc2003b77a6e4b1374c21adb7b8e34d7b

But we did not remove this message, instead, we just change the tips of the message from 'Error' to 'Server Response Message' for these reasons down below:

  1. This message can only be displayed in debug mode and in debug mode we should let developers know more information from model server. When model server try to send a message to developer, it may contain something that model server want developer to know.
  2. The former tips about this message was 'Error', this expression was incorrect and will make developers feel worried. The correct expression should be 'Server Response Message'.
Maplemx commented 2 weeks ago

published in version 3.3.1.2