mirror of
https://github.com/SilasMarvin/lsp-ai.git
synced 2025-12-18 23:14:28 +01:00
Tests passing
This commit is contained in:
@@ -105,7 +105,7 @@ pub enum VectorDataType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
pub struct VectorStore {
|
pub(crate) struct VectorStore {
|
||||||
pub crawl: Option<Crawl>,
|
pub crawl: Option<Crawl>,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub splitter: ValidSplitter,
|
pub splitter: ValidSplitter,
|
||||||
@@ -433,7 +433,7 @@ impl Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_with_vector_store(vector_store: VectorStore) -> Self {
|
pub(crate) fn default_with_vector_store(vector_store: VectorStore) -> Self {
|
||||||
Self {
|
Self {
|
||||||
config: ValidConfig {
|
config: ValidConfig {
|
||||||
memory: ValidMemoryBackend::VectorStore(vector_store),
|
memory: ValidMemoryBackend::VectorStore(vector_store),
|
||||||
|
|||||||
@@ -827,7 +827,8 @@ assert multiply_two_numbers(2, 3) == 6
|
|||||||
assert!(chunks.len() == 1);
|
assert!(chunks.len() == 1);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
chunks[0].text,
|
chunks[0].text,
|
||||||
r#"--file:///filler.py--\n# Multiplies two numbers
|
r#"--file:///filler.py--
|
||||||
|
# Multiplies two numbers
|
||||||
def multiply_two_numbers(x, y):
|
def multiply_two_numbers(x, y):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
@@ -59,11 +59,15 @@ impl GeminiContent {
|
|||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
pub(crate) struct GeminiGenerationConfig {
|
pub(crate) struct GeminiGenerationConfig {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
#[serde(rename = "stopSequences")]
|
||||||
pub(crate) stop_sequences: Vec<String>,
|
pub(crate) stop_sequences: Vec<String>,
|
||||||
|
#[serde(rename = "maxOutputTokens")]
|
||||||
#[serde(default = "max_tokens_default")]
|
#[serde(default = "max_tokens_default")]
|
||||||
pub(crate) max_output_tokens: usize,
|
pub(crate) max_output_tokens: usize,
|
||||||
pub(crate) temperature: Option<f32>,
|
pub(crate) temperature: Option<f32>,
|
||||||
|
#[serde(rename = "topP")]
|
||||||
pub(crate) top_p: Option<f32>,
|
pub(crate) top_p: Option<f32>,
|
||||||
|
#[serde(rename = "topK")]
|
||||||
pub(crate) top_k: Option<f32>,
|
pub(crate) top_k: Option<f32>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,7 +76,9 @@ pub(crate) struct GeminiGenerationConfig {
|
|||||||
#[serde(rename = "camelCase")]
|
#[serde(rename = "camelCase")]
|
||||||
pub(crate) struct GeminiRunParams {
|
pub(crate) struct GeminiRunParams {
|
||||||
contents: Vec<GeminiContent>,
|
contents: Vec<GeminiContent>,
|
||||||
|
#[serde(rename = "systemInstruction")]
|
||||||
system_instruction: GeminiContent,
|
system_instruction: GeminiContent,
|
||||||
|
#[serde(rename = "generationConfig")]
|
||||||
generation_config: Option<GeminiGenerationConfig>,
|
generation_config: Option<GeminiGenerationConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user