mirror of
https://github.com/katanemo/plano.git
synced 2026-06-20 15:28:07 +02:00
add retry
This commit is contained in:
parent
71658ddbd9
commit
a3f93de85d
7 changed files with 29 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use common::configuration::{Agent, AgentPipeline};
|
||||
use common::consts::ARCH_UPSTREAM_HOST_HEADER;
|
||||
use common::consts::{ARCH_UPSTREAM_HOST_HEADER, ENVOY_RETRY_HEADER};
|
||||
use hermesllm::apis::openai::{ChatCompletionsRequest, Message};
|
||||
use hyper::header::HeaderMap;
|
||||
use tracing::{debug, warn};
|
||||
|
|
@ -112,6 +112,11 @@ impl PipelineProcessor {
|
|||
.map_err(|_| PipelineError::AgentNotFound(agent.name.clone()))?,
|
||||
);
|
||||
|
||||
agent_headers.insert(
|
||||
ENVOY_RETRY_HEADER,
|
||||
hyper::header::HeaderValue::from_str("3").unwrap(),
|
||||
);
|
||||
|
||||
let response = self
|
||||
.client
|
||||
.post(&self.llm_endpoint)
|
||||
|
|
@ -160,6 +165,11 @@ impl PipelineProcessor {
|
|||
.map_err(|_| PipelineError::AgentNotFound(terminal_agent.name.clone()))?,
|
||||
);
|
||||
|
||||
agent_headers.insert(
|
||||
ENVOY_RETRY_HEADER,
|
||||
hyper::header::HeaderValue::from_str("3").unwrap(),
|
||||
);
|
||||
|
||||
let response = self
|
||||
.client
|
||||
.post(&self.llm_endpoint)
|
||||
|
|
|
|||
|
|
@ -29,3 +29,4 @@ pub const HALLUCINATION_TEMPLATE: &str =
|
|||
pub const OTEL_COLLECTOR_HTTP: &str = "opentelemetry_collector_http";
|
||||
pub const OTEL_POST_PATH: &str = "/v1/traces";
|
||||
pub const LLM_ROUTE_HEADER: &str = "x-arch-llm-route";
|
||||
pub const ENVOY_RETRY_HEADER: &str = "x-envoy-max-retries";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue