1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4#[derive(Serialize, Deserialize, Debug)]
5pub struct QueryResult {
6 pub query: String,
7 pub follow_up_questions: Option<Vec<String>>,
8 pub answer: Option<String>,
9 pub images: Vec<String>,
10 pub results: Vec<SearchResult>,
11}
12
13#[derive(Serialize, Deserialize, Debug, Clone)]
14pub struct SearchResult {
15 pub title: String,
16 pub url: String,
17 pub content: String,
18 pub score: f64,
19 pub raw_content: Option<String>,
20}
21
22#[derive(Serialize, Deserialize, Debug, Clone)]
23pub struct SearchResponse {
24 pub success: bool,
25 pub command: String,
26 pub data: Option<SearchData>,
27 pub error: Option<String>,
28}
29
30#[derive(Serialize, Deserialize, Debug, Clone)]
31pub struct SearchData {
32 pub query: String,
33 pub answer: Option<String>,
34 pub results: Vec<SearchResult>,
35 pub results_count: usize,
36}
37
38#[derive(Serialize, Deserialize, Debug, Default, JsonSchema, Clone)]
39pub struct SearchOptions {
40 pub query: String,
41 pub limit: Option<usize>,
42}