diff --git a/src/kili/adapters/kili_api_gateway/llm/mappers.py b/src/kili/adapters/kili_api_gateway/llm/mappers.py index 51b505fd4..ef7f6c1f9 100644 --- a/src/kili/adapters/kili_api_gateway/llm/mappers.py +++ b/src/kili/adapters/kili_api_gateway/llm/mappers.py @@ -145,12 +145,14 @@ def map_import_conversations_input(conversations: List[Conversation]) -> Dict: "chatItems": [ { "content": chat_item["content"], + "externalId": chat_item.get("external_id"), "role": chat_item["role"], "modelName": chat_item.get("model_name"), } for chat_item in conversation["chat_items"] ], - "chatExternalId": conversation.get("chat_external_id"), + "externalId": conversation.get("external_id"), + "label": conversation.get("label"), "labeler": conversation["labeler"], "metadata": conversation.get("metadata"), } diff --git a/src/kili/domain/llm.py b/src/kili/domain/llm.py index f0df95785..37e21c39a 100644 --- a/src/kili/domain/llm.py +++ b/src/kili/domain/llm.py @@ -139,13 +139,22 @@ class ChatItem(TypedDict): """Dict that represents a ChatItem.""" content: str - id: str + external_id: str model_name: Optional[str] role: ChatItemRole +class ConversationLabel(TypedDict): + """Dict that represents a ConversationLabel.""" + + completion: Optional[Dict] + conversation: Optional[Dict] + round: Optional[Dict] + + class Conversation(TypedDict): - chat_external_id: Optional[str] + external_id: Optional[str] chat_items: List[ChatItem] + label: Optional[ConversationLabel] labeler: str metadata: Optional[dict]