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

langchain_openai not running in Flutter Web: "The integer literal 9223372036854775807 can't be represented exactly in JavaScript" #207

Closed
2 of 12 tasks
bryantwilliam opened this issue Nov 12, 2023 · 2 comments · Fixed by #209
Assignees
Labels
p:openai_dart openai_dart package. t:bug Something isn't working
Milestone

Comments

@bryantwilliam
Copy link

bryantwilliam commented Nov 12, 2023

System Info

I'm using Flutter Web and I get an error when using langchain_open.dart:

/C:/Users/William/AppData/Local/Pub/Cache/hosted/pub.dev/openai_dart-0.0.2+1/lib/src/generated/schema/create_completion_request.dart:147:31: Error: The integer literal 9223372036854775807 can't be represented exactly in JavaScript.
Try changing the literal to something that can be represented in JavaScript. In JavaScript 9223372036854775808 is the nearest value that can be represented exactly.
  static const seedMaxValue = 9223372036854775807;
                              ^^^^^^^^^^^^^^^^^^^
/C:/Users/William/AppData/Local/Pub/Cache/hosted/pub.dev/openai_dart-0.0.2+1/lib/src/generated/schema/create_chat_completion_request.dart:154:31: Error: The integer literal 9223372036854775807 can't be represented exactly in JavaScript.

Try changing the literal to something that can be represented in JavaScript. In JavaScript 9223372036854775808 is the nearest value that can be represented exactly.
  static const seedMaxValue = 9223372036854775807;
                              ^^^^^^^^^^^^^^^^^^^

Related Components

  • doc-loaders
  • doc-transformers
  • prompts
  • llms
  • chat-models
  • output-parsers
  • chains
  • memory
  • stores
  • embeddings
  • retrievers
  • agents

Reproduction

Flutter web

Just this line: import 'package:langchain_openai/langchain_openai.dart';
And that line produces the same error with or without import 'package:langchain/langchain.dart'; as well.

My pubspec.yaml:

dependencies:
  langchain: ^0.0.15
  langchain_openai: ^0.0.15+1
@bryantwilliam bryantwilliam added the t:bug Something isn't working label Nov 12, 2023
@bryantwilliam bryantwilliam changed the title langchain_openai not working in flutter web langchain_openai not running in Flutter Web: "The integer literal 9223372036854775807 can't be represented exactly in JavaScript" Nov 12, 2023
@davidmigloz davidmigloz self-assigned this Nov 12, 2023
@davidmigloz davidmigloz added the p:openai_dart openai_dart package. label Nov 12, 2023
@davidmigloz
Copy link
Owner

Hi @bryantwilliam,

Thanks for reporting!

I've issued a fix in langchain_openai: 0.0.15+2. I've run all the tests in the browser and all are green now. Let me know if it works fine on your side.

Cheers.

@davidmigloz davidmigloz added this to the v0.0.15 milestone Nov 12, 2023
@bryantwilliam
Copy link
Author

It works, thanks.

KennethKnudsen97 pushed a commit to KennethKnudsen97/langchain_dart that referenced this issue Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p:openai_dart openai_dart package. t:bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants