GithubHelp home page GithubHelp logo

Comments (14)

odedsolutions avatar odedsolutions commented on June 10, 2024 3

This "Hack" would probably just be pulled into the code :)

I'll try to get to it today

from openai.

odedsolutions avatar odedsolutions commented on June 10, 2024 2

Inside my local pub cache for the moment. It's in file called message.dart, but just click on the definition of RequestFunctionMessage and it will take you there.

from openai.

mickeyjoes avatar mickeyjoes commented on June 10, 2024 2

Gotcha, I can confirm changing to below like in your code it now works.

  @override
  Map<String, dynamic> toMap() {
    return {
      "role": role.name,
      "content": content?.map((toolCall) => toolCall.toMap()).toList(),
      "tool_call_id": toolCallId,
    };
  }

I look forward to fix in the next release.
Thanks!

from openai.

anasfik avatar anasfik commented on June 10, 2024 2

I released version 5.0.0 with the fix and some other changes:

Until you can confirm that the issue is fixed 100%, this issue will stay open.

from openai.

odedsolutions avatar odedsolutions commented on June 10, 2024 1

Found the cause - content was naivly encoded. This code works for me:

 @override
  Map<String, dynamic> toMap() {
    return {
      ...super.toMap(),
      "tool_call_id": toolCallId,
    };
    // return {
    //   "role": role.name,
    //   "content": content?.map((contentItem) => contentItem.toMap()).toList(),
    //   "tool_call_id": toolCallId,
    // };
  }

from openai.

mickeyjoes avatar mickeyjoes commented on June 10, 2024 1

@odedsolutions I got the exact same issue. Where did you add that code for the toMap override?

from openai.

sherazahmad720 avatar sherazahmad720 commented on June 10, 2024 1

but now where i can add this to fix this issue?

from openai.

mickeyjoes avatar mickeyjoes commented on June 10, 2024 1

For me on Ubuntu its in pub cache here:
~/.pub-cache/hosted/pub.dev/dart_openai-4.1.4/lib/src/core/models/chat/sub_models/choices/sub_models/message.dart at the end of file line 140 replace toMap with the fixed toMap code.
But hopefully there will be a fix soon in the next version and this "hack" should not be needed.

from openai.

odedsolutions avatar odedsolutions commented on June 10, 2024 1

@anasfik let me know if you want me to do it. (not sure how honestly 😅)

from openai.

anasfik avatar anasfik commented on June 10, 2024 1

I appreciate the effort here, Thank you for notifying me about this.

I will check this right now.

@odedsolutions no worries, I will handle it and inform you about it.

from openai.

anasfik avatar anasfik commented on June 10, 2024 1

@mickeyjoes

Yes, very precise on this, thank you!
I will release

from openai.

mickeyjoes avatar mickeyjoes commented on June 10, 2024 1

Great, thanks @anasfik! Appreciate your work. I'll try the new release during this week and confirm.

from openai.

mickeyjoes avatar mickeyjoes commented on June 10, 2024 1

Awesome! I upgraded to the latest version 5.0.0 and I can confirm the fix works, thanks!

from openai.

odedsolutions avatar odedsolutions commented on June 10, 2024 1

Working for me too on 5.0.0. Thanks!

from openai.

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.