fix(agent): increase max_tokens for merge requests to avoid truncated responses
normalize: 512 tokens (sufficient for single track metadata) merge: 4096 tokens (needed for artists with many albums) Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,7 @@ pub async fn normalize(
|
|||||||
&user_message,
|
&user_message,
|
||||||
state.config.ollama_auth.as_deref(),
|
state.config.ollama_auth.as_deref(),
|
||||||
0.5,
|
0.5,
|
||||||
|
512,
|
||||||
Some(("normalized_metadata", schema.clone())),
|
Some(("normalized_metadata", schema.clone())),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@@ -48,6 +49,7 @@ pub async fn normalize(
|
|||||||
&user_message,
|
&user_message,
|
||||||
state.config.ollama_auth.as_deref(),
|
state.config.ollama_auth.as_deref(),
|
||||||
1.5,
|
1.5,
|
||||||
|
512,
|
||||||
Some(("normalized_metadata", schema)),
|
Some(("normalized_metadata", schema)),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
@@ -185,6 +187,7 @@ pub async fn call_ollama(
|
|||||||
user_message: &str,
|
user_message: &str,
|
||||||
auth: Option<&str>,
|
auth: Option<&str>,
|
||||||
frequency_penalty: f64,
|
frequency_penalty: f64,
|
||||||
|
max_tokens: u32,
|
||||||
schema: Option<(&str, serde_json::Value)>,
|
schema: Option<(&str, serde_json::Value)>,
|
||||||
) -> anyhow::Result<String> {
|
) -> anyhow::Result<String> {
|
||||||
let client = reqwest::Client::builder()
|
let client = reqwest::Client::builder()
|
||||||
@@ -211,7 +214,7 @@ pub async fn call_ollama(
|
|||||||
response_format,
|
response_format,
|
||||||
stream: false,
|
stream: false,
|
||||||
temperature: 0.1,
|
temperature: 0.1,
|
||||||
max_tokens: 512,
|
max_tokens,
|
||||||
frequency_penalty,
|
frequency_penalty,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ pub async fn propose_merge(state: &Arc<AppState>, merge_id: Uuid) -> anyhow::Res
|
|||||||
&user_message,
|
&user_message,
|
||||||
state.config.ollama_auth.as_deref(),
|
state.config.ollama_auth.as_deref(),
|
||||||
0.5,
|
0.5,
|
||||||
|
4096,
|
||||||
Some(("artist_merge", schema)),
|
Some(("artist_merge", schema)),
|
||||||
).await?;
|
).await?;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user