Chainlit / literalai-python

https://docs.getliteral.ai/
Apache License 2.0
8 stars 0 forks source link

fix: conditionnally add BaseMessage id #87

Closed desaxce closed 2 months ago

desaxce commented 2 months ago

Fixing the error:

Exception: Failed to create generation: {"errors":[{"message":"Variable \"$generation\" got invalid value { id: null, promptId: null, provider: \"test\", model: \"test\", error: null, settings: {}, variables: {}, tags: [\"test\"], tools: null, tokenCount: null, inputTokenCount: null, outputTokenCount: null, ttFirstToken: null, tokenThroughputInSeconds: null, duration: null, messages: [{ role: \"user\", content: \"Hello\" }, { role: \"assistant\", content: \"Hi\" }], messageCompletion: { role: \"assistant\", content: \"Hello back!\" }, type: \"CHAT\" }; Field \"id\" is not defined by type \"GenerationPayloadInput\".","locations":[{"line":2,"column":27}],"extensions":{"code":"UNEXPECTED"}}]}

../../miniconda3/envs/tmp-py-client/lib/python3.9/site-packages/literalai/api/__init__.py:1371: Exception