64bit / async-openai

Rust library for OpenAI
https://docs.rs/async-openai
MIT License
1.09k stars 161 forks source link

assistants header #218

Closed kitalia closed 3 months ago

kitalia commented 4 months ago

headers.insert(OPENAI_BETA_HEADER, "assistants=v1".parse().unwrap());

in config.rs line 96 should be updated to

headers.insert(OPENAI_BETA_HEADER, "assistants=v2".parse().unwrap());

that would allow temperature configuration on the openai api frontend, it's an easy fix

UPDATE

it isn't an easy fix because it would make the deserialisation of the response fail due to the new response format

Error: failed deserialization of: { "id": "run_ XXX", "object": "thread.run", "created_at": 1714390612, "assistantid": "asst XXX", "threadid": "thread XXX", "status": "queued", "started_at": null, "expires_at": 1714391212, "cancelled_at": null, "failed_at": null, "completed_at": null, "required_action": null, "last_error": null, "model": "gpt-3.5-turbo-0125", "instructions": "XXX" "tools": [ { "type": "file_search" } ], "tool_resources": {}, "metadata": {}, "temperature": 1.0, "top_p": 0.9, "max_completion_tokens": null, "max_prompt_tokens": null, "truncation_strategy": { "type": "auto", "last_messages": null }, "incomplete_details": null, "usage": null, "response_format": "auto", "tool_choice": "auto" }

64bit commented 3 months ago

This is released in v0.21.0