From 3c11a0a5bf8a30f9ac3e610d5af6b6ac043d497b Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Wed, 17 Jan 2024 21:14:05 +0100 Subject: [PATCH 1/2] support array --- langfuse/api/resources/commons/types/map_value.py | 5 ++++- tests/test_core_sdk.py | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/langfuse/api/resources/commons/types/map_value.py b/langfuse/api/resources/commons/types/map_value.py index f6a7dc9fc..e1e771a9b 100644 --- a/langfuse/api/resources/commons/types/map_value.py +++ b/langfuse/api/resources/commons/types/map_value.py @@ -3,5 +3,8 @@ import typing MapValue = typing.Union[ - typing.Optional[str], typing.Optional[int], typing.Optional[bool] + typing.Optional[str], + typing.Optional[int], + typing.Optional[bool], + typing.Optional[typing.List[str]], ] diff --git a/tests/test_core_sdk.py b/tests/test_core_sdk.py index 43719259f..65a644618 100644 --- a/tests/test_core_sdk.py +++ b/tests/test_core_sdk.py @@ -189,7 +189,11 @@ def test_create_generation(): start_time=timestamp, end_time=timestamp, model="gpt-3.5-turbo", - model_parameters={"max_tokens": "1000", "temperature": "0.9"}, + model_parameters={ + "max_tokens": "1000", + "temperature": "0.9", + "stop": ["user-1", "user-2"], + }, input=[ {"role": "system", "content": "You are a helpful assistant."}, { @@ -222,7 +226,11 @@ def test_create_generation(): assert generation.start_time is not None assert generation.end_time is not None assert generation.model == "gpt-3.5-turbo" - assert generation.model_parameters == {"max_tokens": "1000", "temperature": "0.9"} + assert generation.model_parameters == { + "max_tokens": "1000", + "temperature": "0.9", + "stop": ["user-1", "user-2"], + } assert generation.input == [ {"role": "system", "content": "You are a helpful assistant."}, { From 38357932c1da5735e43fa82baf015a9260238283 Mon Sep 17 00:00:00 2001 From: Max Deichmann Date: Wed, 17 Jan 2024 21:28:15 +0100 Subject: [PATCH 2/2] push --- tests/test_core_sdk.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_core_sdk.py b/tests/test_core_sdk.py index 65a644618..e0bad6bf4 100644 --- a/tests/test_core_sdk.py +++ b/tests/test_core_sdk.py @@ -183,6 +183,7 @@ def test_create_generation(): timestamp = _get_timestamp() generation_id = create_uuid() + langfuse.generation( id=generation_id, name="query-generation",