Coder Social home page Coder Social logo

Comments (4)

dotchcz avatar dotchcz commented on June 25, 2024 1

using System.Text;
using Newtonsoft.Json;

namespace HigLabo.OpenAI
{
public class AssistantDeltaObject
{
public string Id { get; set; } = "";
public string Object { get; set; } = "";
public AssistantDelta Delta { get; set; } = new();

    public class AssistantDelta
    {
        public string Role { get; set; } = "";
        public List<Message> Content { get; set; } = new();
        public List<string>? FileId { get; set; }
        public RunStep? Step_Details { get; set; } 
    }
    public class Message
    {
        public int Index { get; set; }
        public string Type { get; set; } = "";
        public MessageText Text { get; set; } = new();
    }
    public class MessageText
    {
        public string Value { get; set; } = "";
        public Annotation[]? Annotations { get; set; }

        public override string ToString()
        {
            return this.Value;
        }
    }

    public class Annotation
    {
        public int Index { get; set; }
        public string Type { get; set; } = "";
        public string Text { get; set; } = "";
        public string Start_Index { get; set; } = "";
        public string End_Index { get; set; } = "";
        public FileCitation File_Citation { get; set; } = new();
    }

    public class FileCitation
    {
        public string File_Id { get; set; } = "";
        public string Quote { get; set; } = "";
    }

    public class RunStep
    {
        public string Type { get; set; } = "";
        public MessageCreation? Message_Creation { get; set; }
        public List<ToolCall>? Tool_Calls { get; set; }
    }
    public class MessageCreation
    {
        public string Message_Id { get; set; } = "";

    }
    public class ToolCall
    {
        public int Index { get; set; }
        public string Id { get; set; } = "";
        public string Type { get; set; } = "";
        public CodeInterpreter? Code_Interpreter { get; set; } 
    }
    public class CodeInterpreter
    {
        public string Input { get; set; } = "";
        public List<string>? Outputs { get; set; }
    }

    public override string ToString()
    {
        return this.Delta?.Content.FirstOrDefault()?.Text.Value ?? this.Id;
    }
}

}

from higlabo.

higty avatar higty commented on June 25, 2024

@dotchcz
Hi. Thank you for reporting bug and provide bug fix.
I'll patch it if you send me it.

regards.

from higlabo.

dotchcz avatar dotchcz commented on June 25, 2024

@higty
Hi, thank you for you quick reply! I cannot push any change to any branch :) so the class is attached, if it's okay for you.

from higlabo.

higty avatar higty commented on June 25, 2024

I fixed it just now.
And I upload it to Nuget as HigLabo.OpenAI 8.5.0.0.

Thank you for your feedback!

from higlabo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.