Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix for non streaming clients #967

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