From c8a1f04b4c4622c4fb3900dcb22fdbbea2fe7a00 Mon Sep 17 00:00:00 2001 From: hajdul88 <52442977+hajdul88@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:19:50 +0100 Subject: [PATCH] fix: updates the acreate_structured_output --- cognee/infrastructure/llm/openai/adapter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cognee/infrastructure/llm/openai/adapter.py b/cognee/infrastructure/llm/openai/adapter.py index 3eb3528e2..bb5af15f2 100644 --- a/cognee/infrastructure/llm/openai/adapter.py +++ b/cognee/infrastructure/llm/openai/adapter.py @@ -12,7 +12,8 @@ from cognee.infrastructure.llm.llm_interface import LLMInterface from cognee.infrastructure.llm.prompts import read_query_prompt from cognee.base_config import get_base_config -if MonitoringTool.LANGFUSE: +monitoring = get_base_config().monitoring_tool +if monitoring == MonitoringTool.LANGFUSE: from langfuse.decorators import observe class OpenAIAdapter(LLMInterface): @@ -43,7 +44,7 @@ class OpenAIAdapter(LLMInterface): base_config = get_base_config() - @observe() + @observe(as_type='generation') async def acreate_structured_output(self, text_input: str, system_prompt: str, response_model: Type[BaseModel]) -> BaseModel: