Skip to content

Commit

Permalink
Fixing chat args
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Krestnikov authored and Konstantin Krestnikov committed Mar 14, 2024
1 parent 44d8165 commit 6437756
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gigachat"
version = "0.1.18"
version = "0.1.20"
description = "GigaChat. Python-library for GigaChain and LangChain"
authors = ["Konstantin Krestnikov <[email protected]>", "Sergey Malyshev <[email protected]>"]
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions src/gigachat/models/function_paramaers_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ class FunctionParametersProperty(BaseModel):
"""Возможные значения аргумента"""
enum: Optional[List[str]] = None
"""Возможные значения enum"""
properties: Optional[Dict[Any, "FunctionParametersProperty"]] = None
2 changes: 1 addition & 1 deletion src/gigachat/models/messages_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MessagesChunk(BaseModel):

role: Optional[MessagesRole] = None
"""Роль автора сообщения"""
content: str
content: Optional[str] = None
"""Текст сообщения"""
function_call: Optional[FunctionCall] = None
"""Вызов функции"""
2 changes: 1 addition & 1 deletion tests/unit_tests/gigachat/api/test_stream_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_sync_value_error(httpx_mock: HTTPXMock) -> None:
httpx_mock.add_response(url=MOCK_URL, content=b"data: {}", headers=HEADERS_STREAM)

with httpx.Client(base_url=BASE_URL) as client:
with pytest.raises(ValueError, match="3 validation errors for ChatCompletionChunk*"):
with pytest.raises(ValueError, match="4 validation errors for ChatCompletionChunk*"):
list(stream_chat.sync(client, chat=CHAT))


Expand Down

0 comments on commit 6437756

Please sign in to comment.