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

Function role in ChatMessageRole - 7.1.0 beta #303

Closed
oferavnery opened this issue Jun 18, 2023 · 0 comments
Closed

Function role in ChatMessageRole - 7.1.0 beta #303

oferavnery opened this issue Jun 18, 2023 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@oferavnery
Copy link

oferavnery commented Jun 18, 2023

I may have missed it, but in case I didn't I think the ChatMessageRoles Class should probably include a function Role:

public static class ChatMessageRoles
    {
        public static string System => "system";
        public static string User => "user";
        public static string Assistant => "assistant";
        **public static string Function => "function";**
    }

as defined in the new OpenAI API (See "role":"function")

curl https://api.openai.com/v1/chat/completions -u :$OPENAI_API_KEY -H 'Content-Type: application/json' -d '{
  "model": "gpt-3.5-turbo-0613",
  "messages": [
    {"role": "user", "content": "What is the weather like in Boston?"},
    {"role": "assistant", "content": null, "function_call": {"name": "get_current_weather", "arguments": "{ \"location\": \"Boston, MA\"}"}},
    **{"role": "function", "name": "get_current_weather", "content": "{\"temperature\": "22", \"unit\": \"celsius\", \"description\": \"Sunny\"}"}**
  ],
  "functions": [
    {
      "name": "get_current_weather",
      "description": "Get the current weather in a given location",
      "parameters": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and state, e.g. San Francisco, CA"
          },
          "unit": {
            "type": "string",
            "enum": ["celsius", "fahrenheit"]
          }
        },
        "required": ["location"]
      }
    }
  ]
}
@kayhantolga kayhantolga added bug Something isn't working Ready for next version This issue solved and waiting for next release labels Jun 22, 2023
@kayhantolga kayhantolga added this to the 7.2.0 milestone Jul 25, 2023
@kayhantolga kayhantolga removed the Ready for next version This issue solved and waiting for next release label Jul 30, 2023
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