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:
Xavier Gillard
2024-06-07 16:49:55 +02:00
committed by GitHub
parent cf68a77320
commit 2fc0642a5e
2 changed files with 8 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
name: Test
on: push
on:
pull_request:
push:
jobs:
test:

View File

@@ -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)]
pub enum ChatMessageRole {
#[serde(rename = "system")]
System,
#[serde(rename = "assistant")]
Assistant,
#[serde(rename = "user")]
User,
#[serde(rename = "tool")]
Tool,
}
/// The format that the model must output.