mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-05-03 16:22:06 +00:00
feat: added name field to openai message
This commit is contained in:
parent
4c2848b24b
commit
9f67f4226b
@ -338,6 +338,7 @@ impl ChatCompletion {
|
|||||||
message: Message {
|
message: Message {
|
||||||
role: "assistant".into(),
|
role: "assistant".into(),
|
||||||
content: output,
|
content: output,
|
||||||
|
name: None,
|
||||||
},
|
},
|
||||||
logprobs: return_logprobs
|
logprobs: return_logprobs
|
||||||
.then(|| ChatCompletionLogprobs::from((details.tokens, details.top_tokens))),
|
.then(|| ChatCompletionLogprobs::from((details.tokens, details.top_tokens))),
|
||||||
@ -413,6 +414,7 @@ fn default_request_messages() -> Vec<Message> {
|
|||||||
vec![Message {
|
vec![Message {
|
||||||
role: "user".to_string(),
|
role: "user".to_string(),
|
||||||
content: "My name is David and I".to_string(),
|
content: "My name is David and I".to_string(),
|
||||||
|
name: None,
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -507,6 +509,8 @@ pub(crate) struct Message {
|
|||||||
pub role: String,
|
pub role: String,
|
||||||
#[schema(example = "My name is David and I")]
|
#[schema(example = "My name is David and I")]
|
||||||
pub content: String,
|
pub content: String,
|
||||||
|
#[schema(example = "\"David\"")]
|
||||||
|
pub name: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, ToSchema)]
|
#[derive(Clone, Debug, Deserialize, ToSchema)]
|
||||||
|
Loading…
Reference in New Issue
Block a user