feat(chat): add the 'system' and 'tool' message roles (#10)
* add the 'system' and 'tool' message roles (see: https://docs.mistral.ai/capabilities/completion/ ) * docs(chat): add offical doc link in ChatMessageRole * ci(github): listen to pull_request event in Test workflow --------- Co-authored-by: Ivan Gabriele <ivan.gabriele@protonmail.com>
This commit is contained in:
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -1,6 +1,8 @@
|
|||||||
name: Test
|
name: Test
|
||||||
|
|
||||||
on: push
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
|||||||
@@ -30,12 +30,17 @@ impl ChatMessage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// See the [Mistral AI API documentation](https://docs.mistral.ai/capabilities/completion/#chat-messages) for more information.
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
|
||||||
pub enum ChatMessageRole {
|
pub enum ChatMessageRole {
|
||||||
|
#[serde(rename = "system")]
|
||||||
|
System,
|
||||||
#[serde(rename = "assistant")]
|
#[serde(rename = "assistant")]
|
||||||
Assistant,
|
Assistant,
|
||||||
#[serde(rename = "user")]
|
#[serde(rename = "user")]
|
||||||
User,
|
User,
|
||||||
|
#[serde(rename = "tool")]
|
||||||
|
Tool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The format that the model must output.
|
/// The format that the model must output.
|
||||||
|
|||||||
Reference in New Issue
Block a user