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
//! # neuromance
//!
//! A Rust library for controlling and orchestrating LLM interactions.
//!
//! Neuromance provides high-level abstractions for building LLM-powered applications,
//! including conversation management, tool calling, and interaction orchestration.
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use neuromance::{Conversation, Message, Core, CoreEvent, ToolApproval};
//! # use neuromance::OpenAIClient;
//! # let client: OpenAIClient = unimplemented!();
//!
//! // Create a conversation
//! let mut conversation = Conversation::new().with_title("My Chat");
//!
//! // Add messages
//! let user_msg = Message::user(conversation.id, "Hello!");
//! let assistant_msg = Message::assistant(conversation.id, "Hi there!");
//!
//! conversation.add_message(user_msg).expect("Failed to add message");
//! conversation.add_message(assistant_msg).expect("Failed to add message");
//!
//! // Core uses event-driven architecture for streaming and monitoring
//! let core = Core::new(client)
//! .with_streaming()
//! .with_event_callback(|event| async move {
//! match event {
//! CoreEvent::Streaming(chunk) => print!("{}", chunk),
//! CoreEvent::ToolResult { name, .. } => println!("Tool executed: {}", name),
//! CoreEvent::Usage(usage) => println!("Tokens: {}", usage.total_tokens),
//! }
//! })
//! .with_tool_approval_callback(|tool_call| {
//! let tool_call = tool_call.clone();
//! async move {
//! println!("Approve {}?", tool_call.function.name);
//! ToolApproval::Approved // Or prompt user
//! }
//! });
//! ```
//!
//! ## Features
//!
//! - **Conversation Management**: Track multi-turn conversations with metadata and status
//! - **Message Handling**: Support for system, user, assistant, and tool messages
//! - **Tool Calling**: Define and execute function calls from LLM responses
//! - **Serialization**: Full serde support for all types
pub use *;
pub use *;
pub use *;
pub use Core;
pub use ;