Merge pull request #397 from topoteretes/langfuse_generation

Changes langfuse LLM API call tracing to generation
This commit is contained in:
hajdul88 2024-12-20 16:32:25 +01:00 committed by GitHub
commit c0ad53cde7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: