1
0
Fork 0
mirror of https://gitlab.com/bramw/baserow.git synced 2025-04-15 09:34:13 +00:00

OpenAI assistant receives unexpected temperature to message.create call

This commit is contained in:
Przemyslaw Kukulski 2025-03-17 15:56:16 +00:00
parent 678f650705
commit 3a6ce97927
2 changed files with 13 additions and 4 deletions
backend/src/baserow/core/generative_ai
changelog/entries/unreleased/bug

View file

@ -118,26 +118,27 @@ class OpenAIGenerativeAIModelType(
run, thread, assistant = None, None, None
try:
client = self.get_client(workspace)
kwargs = {}
if temperature:
kwargs["temperature"] = temperature
assistant = client.beta.assistants.create(
name="Assistant that have access to user files",
instructions="",
model=model,
tools=[{"type": "file_search"}],
**kwargs,
)
thread = client.beta.threads.create()
attachments = [
{"file_id": file_id, "tools": [{"type": "file_search"}]}
for file_id in file_ids
]
kwargs = {}
if temperature:
kwargs["temperature"] = temperature
message = client.beta.threads.messages.create(
thread_id=thread.id,
role="user",
content=prompt,
attachments=attachments,
**kwargs,
)
run = client.beta.threads.runs.create_and_poll(
thread_id=thread.id,

View file

@ -0,0 +1,8 @@
{
"type": "bug",
"message": "Fix issue with unexpected temperature argument passed to OpenAI messages.create",
"domain": "database",
"issue_number": 3384,
"bullet_points": [],
"created_at": "2025-03-13"
}