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

feat: Added support for streaming in chat as a run_manager #9

Merged
merged 4 commits into from
Aug 8, 2024

Conversation

MateuszOssGit
Copy link
Collaborator

Added support for streaming in chat as a run_manager

Before:

chat = ChatWatsonx(
    url=credentials["url"],
    apikey=credentials["apikey"],
    model_id=model_id,
    project_id=project_id, 
    streaming=True
)
chat.invoke("hello")

# Out
 AttributeError: 'ChatGenerationChunk' object has no attribute 'content'

After:

chat = ChatWatsonx(
    url=credentials["url"],
    apikey=credentials["apikey"],
    model_id=model_id,
    project_id=project_id, 
    streaming=True
)
chat.invoke("hello")

# Out
AIMessage(content='Hello. How can I help you?', response_metadata={'finish_reason': 'eos_token'}, id='sample_id')

Copy link
Collaborator

@Mateusz-Switala Mateusz-Switala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MateuszOssGit MateuszOssGit merged commit e9a7c79 into main Aug 8, 2024
12 checks passed
@MateuszOssGit MateuszOssGit deleted the dev-added-support-for-streaming-in-chat branch August 8, 2024 10:55
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 this pull request may close these issues.

2 participants