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

Stateless models #1976

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

Stateless models #1976

wants to merge 11 commits into from

Conversation

ashpreetbedi
Copy link
Contributor

Description


Type of change

Please check the options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Model update (Addition or modification of models)
  • Other (please describe):

@ashpreetbedi ashpreetbedi requested a review from a team as a code owner February 1, 2025 23:54
def set_functions(self, functions: Dict[str, Function]) -> None:
self._functions = functions

# @staticmethod
Copy link
Contributor Author

Choose a reason for hiding this comment

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

keeping around just in case, will be deleted once this PR is ready

@@ -238,60 +204,6 @@ def _get_function_calls_to_run(
function_calls_to_run.append(_function_call)
return function_calls_to_run

def add_tool(
Copy link
Contributor

Choose a reason for hiding this comment

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

Gemini will need a refactor, since it has a custom add_tools

if self.tool_choice is None:
request_params["tool_choice"] = "auto"
else:
if self.tool_choice is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't you missing auto as a default here?


# -*- Generate response
metrics.start_response_timer()
assistant_message.metrics.start_timer()
Copy link
Contributor

Choose a reason for hiding this comment

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

This is nice

metrics.completion_tokens += 1
if metrics.completion_tokens == 1:
metrics.time_to_first_token = metrics.response_timer.elapsed
assistant_message.metrics.completion_tokens += 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not use the completion tokens from the response? I always thought this was weird, because a delta isn't necessarily one token right?

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