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

com.openai.unity 8.0.0 #235

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

com.openai.unity 8.0.0 #235

wants to merge 8 commits into from

Conversation

StephenHodgson
Copy link
Member

  • Updated Assistants Beta v2
  • Added BatchEndpoint
  • Added VectorStoresEndpoint

- Updated Assistants Beta v2
- Added BatchEndpoint
- Added VectorStoresEndpoint
Copy link

@Bodekaer Bodekaer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StephenHodgson I believe the dynamic keyword isn't supported on all platforms like WebGL and requires .NET 4.0 (doesn't work w/ 2.1).

Any chance we can avoid using dynamic?

[EnumMember(Value = "text")]
Text,
[EnumMember(Value = "json_object")]
Json
Copy link

@Bodekaer Bodekaer May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StephenHodgson Is ResponseFormat auto no longer supported?
I get the following error during AssistantRequest endpoint:

ArgumentException: Could not cast or convert from System.String to OpenAI.ResponseFormatObject.

Example JSON:

  "object": "list",
  "data": [
    {
      "id": "...",
      "object": "assistant",
      "created_at": ...,
      "name": "...",
      "description": "...",
      "model": "gpt-4o",
      "instructions": "...",
      "tools": [],
      "top_p": 1.0,
      "temperature": 1.0,
      "tool_resources": {},
      "metadata": {},
      "response_format": "auto"
    }
  ]
}```

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this was if I retrieved an existing assistant which had the response_format set to 'auto'.
I've deleted the assistant for now to avoid the above issue, as it does look like auto isn't part of the v2 assistant documentation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out this was if I retrieved an existing assistant

Do you remember which version it was?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was also a v2 Assistant. So interestingly, it does seem to be possible to set it to auto :)

var jsonContent = JsonConvert.SerializeObject(request, OpenAIClient.JsonSerializationOptions);
UnityEngine.Debug.Log(jsonContent);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI These two debug lines can probably be removed in final PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np, was planning on it. Still working out the last changes needed

fixing a super old typo

Co-authored-by: Stephen Hodgson <rage.against.the.pixel@gmail.com>
@StephenHodgson StephenHodgson mentioned this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants