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

promote empty chunk tolerance param into ChatCompletionClient #5210

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MohMaz
Copy link
Contributor

@MohMaz MohMaz commented Jan 26, 2025

Why are these changes needed?

The max_consecutive_empty_chunk_tolerance param was implemented for open ai client, this PR properly promotes it to the ChatCompletionClient protocol to enforce it to all of the implementations.

Didn't update the docs as another contributor is helping with the updates.

Related issue number

Related #5078

Checks

@MohMaz MohMaz self-assigned this Jan 26, 2025
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.08%. Comparing base (8428462) to head (7f49048).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5210   +/-   ##
=======================================
  Coverage   70.08%   70.08%           
=======================================
  Files         179      179           
  Lines       11619    11619           
=======================================
  Hits         8143     8143           
  Misses       3476     3476           
Flag Coverage Δ
unittests 70.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MohMaz MohMaz requested review from lspinheiro and ekzhu January 26, 2025 22:18
@MohMaz MohMaz marked this pull request as ready for review January 26, 2025 22:18
@MohMaz MohMaz enabled auto-merge (squash) January 26, 2025 22:19
@MohMaz MohMaz changed the title update empty chunk tolerance param in create_streams promote empty chunk tolerance param into ChatCompletionClient Jan 26, 2025
Copy link
Collaborator

@ekzhu ekzhu left a comment

Choose a reason for hiding this comment

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

Do we need to have this or is it to address the peculiarity of open AI API.

@MohMaz
Copy link
Contributor Author

MohMaz commented Jan 27, 2025

Do we need to have this or is it to address the peculiarity of open AI API.

This was just for the OpenAI, and my understanding of this message was that we need to make this fix first. I personally lean towards making sure all of the implementations of ChatCompletionClient have exact same signature.

@MohMaz MohMaz requested a review from ekzhu January 27, 2025 19:11
@ekzhu
Copy link
Collaborator

ekzhu commented Jan 27, 2025

Won't other new model clients such as Ollama and Azure AI will have their own version of keyword arguments to address different types of issues? Generally we would like to keep the base class method as lean as possible.

@MohMaz
Copy link
Contributor Author

MohMaz commented Jan 29, 2025

Won't other new model clients such as Ollama and Azure AI will have their own version of keyword arguments to address different types of issues? Generally we would like to keep the base class method as lean as possible.

Makes sense and I agree. Maybe I misunderstood this message. If you can clarify, I can update/close this PR and do the next part of streaming integration with the UI.

@ekzhu
Copy link
Collaborator

ekzhu commented Jan 29, 2025

Won't other new model clients such as Ollama and Azure AI will have their own version of keyword arguments to address different types of issues? Generally we would like to keep the base class method as lean as possible.

Makes sense and I agree. Maybe I misunderstood this message. If you can clarify, I can update/close this PR and do the next part of streaming integration with the UI.

Sorry for the confusion. I meant the keyword arguments should go after a * in the base class's abstract method.

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