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

OpenAI functions dont work with async streaming... #6225

Closed
2 of 14 tasks
ju-bezdek opened this issue Jun 15, 2023 · 0 comments · Fixed by #6226
Closed
2 of 14 tasks

OpenAI functions dont work with async streaming... #6225

ju-bezdek opened this issue Jun 15, 2023 · 0 comments · Fixed by #6226

Comments

@ju-bezdek
Copy link
Contributor

System Info

Version: 0.0.200

Who can help?

@hwchase17 , @agola11

  • I have a PR ready ... creating an issue so I can pair it

Information

  • The official example notebooks/scripts
  • My own modified scripts

Related Components

  • LLMs/Chat Models
  • Embedding Models
  • Prompts / Prompt Templates / Prompt Selectors
  • Output Parsers
  • Document Loaders
  • Vector Stores / Retrievers
  • Memory
  • Agents / Agent Executors
  • Tools / Toolkits
  • Chains
  • Callbacks/Tracing
  • Async

Reproduction

...
openai.py
async def _agenerate( ...

has different implementation than def generate...

when running the chain with acall >>

  1. fails on
    inner_completion += token # token is null, raises error

and after fix the function call was not captured...

Expected behavior

the same as generate

ju-bezdek added a commit to ju-bezdek/langchain that referenced this issue Jun 15, 2023
hwchase17 pushed a commit that referenced this issue Jun 19, 2023
Related to this #6225

Just copied the implementation from `generate` function to `agenerate`
and tested it.

Didn't run any official tests thought

<!--
Thank you for contributing to LangChain! Your PR will appear in our
release under the title you set. Please make sure it highlights your
valuable contribution.

Replace this with a description of the change, the issue it fixes (if
applicable), and relevant context. List any dependencies required for
this change.

After you're done, someone will review your PR. They may suggest
improvements. If no one reviews your PR within a few days, feel free to
@-mention the same people again, as notifications can get lost.

Finally, we'd love to show appreciation for your contribution - if you'd
like us to shout you out on Twitter, please also include your handle!
-->

<!-- Remove if not applicable -->

Fixes #6225

#### Before submitting

<!-- If you're adding a new integration, please include:

1. a test for the integration - favor unit tests that does not rely on
network access.
2. an example notebook showing its use


See contribution guidelines for more information on how to write tests,
lint
etc:


https://github.com/hwchase17/langchain/blob/master/.github/CONTRIBUTING.md
-->

#### Who can review?

Tag maintainers/contributors who might be interested:
  @hwchase17, @agola11

<!-- For a quicker response, figure out the right person to tag with @

  @hwchase17 - project lead

  Tracing / Callbacks
  - @agola11

  Async
  - @agola11

  DataLoaders
  - @eyurtsev

  Models
  - @hwchase17
  - @agola11

  Agents / Tools / Toolkits
  - @hwchase17

  VectorStores / Retrievers / Memory
  - @dev2049

 -->
This was referenced Jun 25, 2023
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

Successfully merging a pull request may close this issue.

1 participant