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

Assistants v2 #224

Closed
wants to merge 3 commits into from
Closed

Conversation

dnnkeeper
Copy link

@dnnkeeper dnnkeeper commented Apr 30, 2024

This is a small rough update to v2 beta helpers with support for delta streaming and new authorization using project keys. It also includes updates to AudioTranscriptionRequest to handle encoded audio streams (I'm using Vorbis encoding in my project, which I may post later as a sample).
I don't have time to create proper test cases and documentation, so you can use this branch as a reference for future updates if you find it useful.

…ons, new auth methods with project key, addded audio stream as System.Stream and as encoded byte array,
# Conflicts:
#	OpenAI/Packages/com.openai.unity/Runtime/Threads/CreateRunRequest.cs
@@ -15,7 +15,7 @@ public sealed class OpenAIAuthInfo : IAuthInfo
internal const string SessionKeyPrefix = "sess-";
internal const string OrganizationPrefix = "org-";

public OpenAIAuthInfo(string apiKey, string organizationId = null)
public OpenAIAuthInfo(string apiKey, string organizationId = null, string project = null)
Copy link
Member

Choose a reason for hiding this comment

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

does this id have a prefix?

float? temperature = null,
string language = null,
TimestampGranularity timestampGranularity = TimestampGranularity.None)
: this(audioStream, $"UserSpeech.wav", model, prompt, responseFormat, temperature, language, timestampGranularity)
Copy link
Member

Choose a reason for hiding this comment

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

make audioName required param

{ "OpenAI-Beta", "assistants=v1"}
{ "OpenAI-Beta", "assistants=v2"}
Copy link
Member

Choose a reason for hiding this comment

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

these changes should be broken out into a separate PR from the projectId changes

internal static JsonSerializerSettings JsonSerializationOptions { get; } = new()
public static JsonSerializerSettings JsonSerializationOptions { get; } = new()
Copy link
Member

Choose a reason for hiding this comment

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

revert

Copy link
Member

@StephenHodgson StephenHodgson left a comment

Choose a reason for hiding this comment

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

Most of these changes are breaking and will be done in 8.x which needs to first be completed upstream in OpenAI-DotNet

@ElisMia
Copy link

ElisMia commented May 2, 2024

Most of these changes are breaking and will be done in 8.x which needs to first be completed upstream in OpenAI-DotNet

That would be awesome. Do you know when version 8 will be available?

@StephenHodgson
Copy link
Member

That would be awesome. Do you know when version 8 will be available?

Hard to say as I do this in my free time.

@StephenHodgson
Copy link
Member

Closing this in favor of #235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants