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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
use ;
use fmt;
/// Enum representing different Large Language Model (LLM) providers.
///
/// This enum is used to specify which LLM framework to use when interacting with AI models.
/// It supports three providers: OpenAI, Anthropic, and Ollama.
///
/// ### Example Usage:
///
/// ```rust,ignore
/// use ask_ai::config::Framework;
///
/// let framework = Framework::OpenAI; // Use OpenAI as the LLM provider
/// assert_eq!(framework.to_string(), "openai");
/// ```
/// Configuration for interacting with an AI model.
///
/// This struct defines the necessary configuration for querying an AI model, including the
/// framework provider, the specific model to use, and an optional maximum token limit for responses.
///
/// ### Example Usage:
///
/// ```rust,ignore
/// use ask_ai::config::{AiConfig, Framework};
///
/// let ai_config = AiConfig {
/// llm: Framework::OpenAI, // Specify the framework provider
/// model: "gpt-4".to_string(), // Specify the model to use
/// max_token: Some(1000), // Optional: Limit the response to 1000 tokens
/// };
/// ```
/// Represents a single prompt and its corresponding AI response.
///
/// This struct is used to store a user's input (`content`) and the AI's output (`output`).
/// It is typically used in a conversation history to maintain context.
///
/// ### Example Usage:
///
/// ```rust,ignore
/// use ask_ai::config::AiPrompt;
///
/// let prompt = AiPrompt {
/// content: "What is Rust?".to_string(), // User's input
/// output: "Rust is a systems programming language...".to_string(), // AI's response
/// };
/// ```
/// Represents a question or query to the AI, including optional context.
///
/// This struct is used to define a question or query to the AI, along with optional
/// system prompts and conversation history for context.
///
/// ### Example Usage:
///
/// ```rust,ignore
/// use ask_ai::config::{Question, AiPrompt};
///
/// let question = Question {
/// system_prompt: Some("You are a helpful assistant.".to_string()), // Optional system prompt
/// messages: Some(vec![
/// AiPrompt {
/// content: "What is Rust?".to_string(),
/// output: "Rust is a systems programming language...".to_string(),
/// },
/// ]), // Optional conversation history
/// new_prompt: "Tell me more about Rust.".to_string(), // New user prompt
/// };
/// ```