1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! # neuromance-common
//!
//! Common types and data structures for LLM conversation and tool management.
//!
//! This crate provides the foundational types for building LLM-powered applications:
//! - Conversation and message management
//! - Tool/function calling support
//! - Serializable data structures for persistence and API communication
//!
//! ## Example
//!
//! ```
//! use neuromance_common::{Conversation, Message, ToolCall, Tool, Function};
//! use uuid::Uuid;
//!
//! // Create a new conversation
//! let conv = Conversation::new()
//! .with_title("Time Assistant")
//! .with_description("Helping users get the current time");
//!
//! // Add a user message
//! let msg = Message::user(conv.id, "What time is it?");
//!
//! // Define a tool using the builder pattern
//! let tool = Tool::builder()
//! .function(Function {
//! name: "get_current_time".to_string(),
//! description: "Get the current date and time in UTC format. Takes no parameters.".to_string(),
//! parameters: serde_json::json!({
//! "type": "object",
//! "properties": {},
//! "required": [],
//! }),
//! })
//! .build();
//!
//! // Or using struct initialization (the r#type field defaults to "function")
//! let tool_alt = Tool {
//! r#type: "function".to_string(),
//! function: Function {
//! name: "get_current_time".to_string(),
//! description: "Get the current date and time in UTC format. Takes no parameters.".to_string(),
//! parameters: serde_json::json!({
//! "type": "object",
//! "properties": {},
//! "required": [],
//! }),
//! },
//! };
//!
//! // Create a tool call using the into() conversion
//! let tool_call = ToolCall::new("get_current_time", Vec::<String>::new());
//! ```
/// Chat conversation and message types.
///
/// Provides types for managing conversations, messages, and message roles.
/// Client configuration and request/response types.
///
/// Contains types for configuring LLM clients and making chat completion requests.
/// Tool calling and function execution types.
///
/// Provides types for defining and executing functions/tools that LLMs can call.
pub use ;
pub use ;
pub use ;
pub use ;