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

Whether chat_engine can call stream_complete()? #13527

Open
1 task done
cxycxm opened this issue May 16, 2024 · 5 comments
Open
1 task done

Whether chat_engine can call stream_complete()? #13527

cxycxm opened this issue May 16, 2024 · 5 comments
Labels
question Further information is requested

Comments

@cxycxm
Copy link

cxycxm commented May 16, 2024

Question Validation

  • I have searched both the documentation and discord for an answer.

Question

Whether chat_engine can call stream_complete()?

@cxycxm cxycxm added the question Further information is requested label May 16, 2024
Copy link

dosubot bot commented May 16, 2024

Hey there, @cxycxm! 🚀 Good to see you back with another intriguing question. Just diving into the depths to fetch your answer. Hang tight!

@logan-markewich
Copy link
Collaborator

logan-markewich commented May 16, 2024

the method you are looking for is chat_engine.stream_chat()

response = chat_engine.stream_chat("Hello!")
for token response.response_gen:
  print(token, end="", flush=True)

Copy link

dosubot bot commented May 16, 2024

To directly address your question, chat_engine does not have a method named stream_complete(). Instead, as highlighted by the maintainer, you should use chat_engine.stream_chat() to handle streaming chat responses. Here's a quick recap on how to use it:

response = chat_engine.stream_chat("Hello!")
for token in response.response_gen:
  print(token, end="", flush=True)

This approach allows you to process and print each token received from the chat engine in real-time. If you have any more questions or need further clarification, feel free to ask!

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@cxycxm
Copy link
Author

cxycxm commented May 16, 2024

but i need stream_complete(),my purpose is to complete the conversation

@logan-markewich
Copy link
Collaborator

That's not how it works with chat engines sadly. Completion only makes sense if you have a single string, not a an alternating chat history.

You can prompt it with a chat history and take the llms response as a completion of the previous message if you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants