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

Method not found: 'Boolean HigLabo.Core.ServerSentEventLine.IsEvent() #83

Closed
CrisDevMF opened this issue Mar 20, 2024 · 8 comments
Closed

Comments

@CrisDevMF
Copy link

hi,

Method not found: 'Boolean HigLabo.Core.ServerSentEventLine.IsEvent()

i'm facing this issue when calling RunCreateStreamAsync => GetStreamAsync => item.IsEvent()

it says it doesn't exist.

in this ServerSentEventLine struct, i actually can't see it.

I am using latest vession

Thanks in advance

@CrisDevMF
Copy link
Author

Btw this library is amazing and so helpful. Thank you so much for it

@higty
Copy link
Owner

higty commented Mar 23, 2024

Thank you! I hope this library help your work!
Please update HigLabo.Core to latest version. It may solve your problem.

@CrisDevMF
Copy link
Author

Super!!!! Thank you.

Yeah, it's definitely helpful.

Also, i was looking int get images/files they generate. Do you have this implemented?

Thanks in advance

@lofti198
Copy link

Thank you! I hope this library help your work! Please update HigLabo.Core to latest version. It may solve your problem.

Hi! Installed the latest version just now. Getting the same error here:
image

Code:

public static async Task Do()
{
    var cl = new OpenAIClient(Environment.GetEnvironmentVariable(Consts.ENV_VAR_OPEN_API_KEY));
    var assistantId = Consts.ASST_ID;
    var threadId = "";
    if (threadId.Length == 0)
    {
        var res = await cl.ThreadCreateAsync();
        threadId = res.Id;
    }
    {
        var p = new MessageCreateParameter();
        p.Thread_Id = threadId;
        p.Role = "user";
        p.Content = $"Hello! I want to know how to use OpenAI assistant API to get stream response.";
        var res = await cl.MessageCreateAsync(p);
    }
    {
        var p = new RunCreateParameter();
        p.Assistant_Id = assistantId;
        p.Thread_Id = threadId;
        p.Stream = true;
        var result = new AssistantMessageStreamResult();
        await foreach (string text in cl.RunCreateStreamAsync
                      (p, result, CancellationToken.None))
        {
            Console.Write(text);
        }
        Console.WriteLine();
        // You can get each server sent event value by these property.
        Console.WriteLine(JsonConvert.SerializeObject(result.Thread));
        Console.WriteLine(JsonConvert.SerializeObject(result.Run));
        Console.WriteLine(JsonConvert.SerializeObject(result.RunStep));
        Console.WriteLine(JsonConvert.SerializeObject(result.Message));
    }

}

Thank you in advance!

@higty
Copy link
Owner

higty commented Mar 29, 2024

I think it may be bug.
I'll upload new version within 12 hours.
Please wait.

Thank you for your detail investigation!

@higty
Copy link
Owner

higty commented Mar 29, 2024

I just upload latest version to Nuget.

@higty
Copy link
Owner

higty commented Mar 29, 2024

OpenAISample_20240330.zip
I confirmed this works perfectly.
Please check it out!!!

@lofti198
Copy link

It works! Great thank you for your job!!!

@higty higty closed this as completed Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants