async-openai
async-openai copied to clipboard
Add extra_body to CreateChatCompletionRequest
OpenAI's Python library allows adding extra arguments to the request body via the extra_body kwarg. This is useful to, e.g., control thinking modes for Qwen. This PR adds the extra_body field to CreateChatCompletionRequest to accomplish the same.
This can be achieved with byot feature:
pub struct CustomCreateChatCompletionRequest {
#[serde(flatten)]
pub request: CreateChatCompletionRequest,
#[serde(flatten)]
pub extra_body: Option<Map<String, Value>>,
}
Please consider using byot https://github.com/64bit/async-openai?tab=readme-ov-file#bring-your-own-types , hence closing