Skip to content

Commit d021b2c

Browse files
committed
more docs, reexport ollama
1 parent c3377d8 commit d021b2c

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

Cargo.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

executor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ thiserror.workspace = true
2828

2929
enum-iterator = "2.1.0"
3030
rig-core = "0.11.1"
31-
ollama-rs = { version = "0.3.0", features = ["tokio"] }
31+
ollama-rs = { version = "0.3.0", features = ["tokio", "rustls", "stream"] }
3232

3333
[dev-dependencies]
3434
# only used for tests

executor/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ pub use task::{TaskBody, TaskResult};
1212

1313
pub use rig::completion::CompletionModel;
1414
pub use rig::completion::PromptError;
15+
16+
// re-export ollama_rs
17+
pub use ollama_rs;

executor/src/task.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ pub type TaskResult = Result<String, PromptError>;
1111

1212
/// The body of a task request that includes the messages and the model to use.
1313
///
14-
/// Implements a deserializer to convert from object with a `model` field and
15-
/// a `messages` field with an array of messages of the form
16-
/// `{role: string, content: string}` to itself.
14+
/// Implements a custom [`Deserialize`] to convert from an object of the form below to self:
1715
///
16+
/// ```ts
17+
/// {
18+
/// "model": string,
19+
/// "messages": { role: string, content: string }[]
20+
/// }
21+
/// ```
22+
///
23+
/// For the `messages` array, the following rules apply:
1824
/// - If the first message is a system message, it will be stored in the `preamble` field.
1925
/// - The last message must be a user message, and it will be stored in the `prompt` field.
20-
/// - All other messages will be stored in the `chat_history` field.
26+
/// - All other intermediate messages will be stored in the `chat_history` field.
2127
#[derive(Debug, Clone)]
2228
pub struct TaskBody {
2329
/// An optional system prompt.

0 commit comments

Comments
 (0)