mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-08-22 23:25:39 +00:00
Merge pull request #42 from draftoai/draftoai/fix-response-format
Switch to serde_json::Value for the response_format type
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
use serde::ser::SerializeMap;
|
use serde::ser::SerializeMap;
|
||||||
use serde::{Deserialize, Serialize, Serializer};
|
use serde::{Deserialize, Serialize, Serializer};
|
||||||
|
use serde_json::Value;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use crate::impl_builder_methods;
|
use crate::impl_builder_methods;
|
||||||
@ -49,7 +50,7 @@ pub struct ChatCompletionRequest {
|
|||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub n: Option<i64>,
|
pub n: Option<i64>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub response_format: Option<String>,
|
pub response_format: Option<Value>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub stream: Option<bool>,
|
pub stream: Option<bool>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
@ -95,7 +96,7 @@ impl_builder_methods!(
|
|||||||
temperature: f64,
|
temperature: f64,
|
||||||
top_p: f64,
|
top_p: f64,
|
||||||
n: i64,
|
n: i64,
|
||||||
response_format: String,
|
response_format: Value,
|
||||||
stream: bool,
|
stream: bool,
|
||||||
stop: Vec<String>,
|
stop: Vec<String>,
|
||||||
max_tokens: i64,
|
max_tokens: i64,
|
||||||
|
Reference in New Issue
Block a user