You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[derive(Debug,Clone,Derivative,Serialize,Deserialize,ToSchema)]#[derivative(Default)]#[serde(default)]pubstructNucleusParams{#[derivative(Default(value = "0.5"))]pubtop_p:f32,#[derivative(Default(value = "128"))]pubtop_k:usize,#[derivative(Default(value = "1.0"))]pubtemperature:f32,#[derivative(Default(value = "0.3"))]pubpresence_penalty:f32,#[derivative(Default(value = "0.3"))]pubfrequency_penalty:f32,#[derivative(Default(value = "0.99654026"))]pubpenalty_decay:f32,}#[derive(Debug,Derivative,Deserialize,ToSchema)]#[derivative(Default)]#[serde(default)]#[salvo(schema( example = json!({"messages":[{"role":"user","content":"Hi!"},{"role":"assistant","content":"Hello, I am your AI assistant. If you have any questions or instructions, please let me know!"},{"role":"user","content":"Tell me about water."}],"names":{"user":"User","assistant":"Assistant"},"template":{"record":"{role}: {content}","prefix":"{assistant}:","sep":"\n\n"},"stop":["\n\nUser:"],"stream":false,"max_tokens":1000,"sampler_override":{"type":"Nucleus","top_p":0.5,"top_k":128,"temperature":1,"presence_penalty":0.3,"frequency_penalty":0.3,"penalty_decay":0.99654026},"state":"00000000-0000-0000-0000-000000000000"})))]structChatRequest{messages:Array<ChatRecord>,names:HashMap<Role,String>,template:ChatTemplate,state:InputState,#[derivative(Default(value = "256"))]max_tokens:usize,#[derivative(Default(value = "Array::Item(\"\\n\\n\".into())"))]stop:Array<String>,stream:bool,#[serde(alias = "logit_bias")]bias:HashMap<u16,f32>,bnf_schema:Option<String>,#[serde(flatten)]sampler:NucleusParams,sampler_override:Option<SamplerParams>,}
With #[serde(flatten)], there is an error on ToSchema:
error[E0599]: no method named `example` found for struct `salvo::salvo_oapi::schema::AllOf` in the current scope
--> crates\ai00-server\src\api\oai\chat.rs:67:42
|
67 | #[derive(Debug, Derivative, Deserialize, ToSchema)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no method named `example` found for struct `salvo::salvo_oapi::schema::AllOf` in the current scope
--> crates\ai00-server\src\api\oai\completion.rs:23:42
|
23 | #[derive(Debug, Derivative, Deserialize, ToSchema)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `ToSchema` (in Nightly builds, run with -Z macro-backtrace for more info)
The text was updated successfully, but these errors were encountered:
Here is the definition of types:
With
#[serde(flatten)]
, there is an error onToSchema
:The text was updated successfully, but these errors were encountered: