Forge.OpenAI icon indicating copy to clipboard operation
Forge.OpenAI copied to clipboard

String Constants for Assistants API

Open sevzas opened this issue 1 year ago • 4 comments

This is a feature request.

It would be great if Forge.OpenAI had string constants defined for:

  1. RunResponse.Status . They are documented here: https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps It would also be nice to have a method "IsTerminalState" that takes a state and returns true if the state is "expired", "completed", "failed" or "cancelled".
  2. Message.Role - there are "system", "user" and "assistant".

This request is similar to what is already in place for Content.CONTENT_TYPE_XXXX

Feel free to close this request if it's out of scope.

sevzas avatar Mar 22 '24 12:03 sevzas

As I see now in the API doc, only the "user" is supported as role value in the Message: https://platform.openai.com/docs/api-reference/messages/createMessage#messages-createmessage-role

JZO001 avatar Mar 22 '24 12:03 JZO001

For the point one, I recommend you to create extension methods where you can implement additional methods which can fit for your workflow.

JZO001 avatar Mar 22 '24 12:03 JZO001

"user" is the only the only value that an end-user of the API can specify on a message BUT when I examine a List of messages (for a Run), I will encounter "system" and "assistant" messages. The "assistant" messages contain the model's responses.

sevzas avatar Mar 22 '24 12:03 sevzas

I see, than I add them as constants into the response. In the next version.

JZO001 avatar Mar 22 '24 13:03 JZO001