From f8d6a3e6120a9d5b1669c67f16165fd704fea5ab Mon Sep 17 00:00:00 2001 From: Anton Dubovik Date: Tue, 1 Oct 2024 13:18:46 +0100 Subject: [PATCH] fix: turned List ot Sequence in content parts --- aidial_sdk/chat_completion/__init__.py | 3 +++ aidial_sdk/chat_completion/request.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aidial_sdk/chat_completion/__init__.py b/aidial_sdk/chat_completion/__init__.py index 17c756d..db42add 100644 --- a/aidial_sdk/chat_completion/__init__.py +++ b/aidial_sdk/chat_completion/__init__.py @@ -9,6 +9,9 @@ FunctionCall, FunctionChoice, Message, + MessageContentImagePart, + MessageContentPart, + MessageContentTextPart, Request, ResponseFormat, Role, diff --git a/aidial_sdk/chat_completion/request.py b/aidial_sdk/chat_completion/request.py index bac1a8a..8901904 100644 --- a/aidial_sdk/chat_completion/request.py +++ b/aidial_sdk/chat_completion/request.py @@ -1,5 +1,5 @@ from enum import Enum -from typing import Any, Dict, List, Literal, Mapping, Optional, Union +from typing import Any, Dict, List, Literal, Mapping, Optional, Sequence, Union from aidial_sdk.chat_completion.enums import Status from aidial_sdk.deployment.from_request_mixin import FromRequestDeploymentMixin @@ -78,7 +78,7 @@ class MessageContentTextPart(ExtraForbidModel): class Message(ExtraForbidModel): role: Role - content: Optional[Union[StrictStr, List[MessageContentPart]]] = None + content: Optional[Union[StrictStr, Sequence[MessageContentPart]]] = None custom_content: Optional[CustomContent] = None name: Optional[StrictStr] = None tool_calls: Optional[List[ToolCall]] = None