Skip to content

Fix for non streaming clients #967

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

Merged
merged 3 commits into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/codegate/providers/formatting/input_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import AsyncIterator, Union

from litellm import ModelResponse
from litellm.types.utils import Delta, StreamingChoices
from litellm.types.utils import Choices, Delta, Message, StreamingChoices

from codegate.db.connection import DbRecorder
from codegate.pipeline.base import PipelineContext, PipelineResponse
Expand Down Expand Up @@ -56,7 +56,12 @@ def _create_model_response(
else:
return ModelResponse(
id=response_id,
choices=[{"text": content, "index": 0, "finish_reason": None}],
# choices=[{"text": content, "index": 0, "finish_reason": None}],
choices=[
Choices(
message=Message(content=content, role="assistant"),
)
],
created=created,
model=model,
)
Expand Down