mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
Merge branch 'main' into adil/add_acm_demo
This commit is contained in:
commit
285a66fdb6
40 changed files with 5270 additions and 1124 deletions
|
|
@ -194,17 +194,11 @@ pub struct Parameter {
|
|||
pub in_path: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct EndpointDetails {
|
||||
pub name: String,
|
||||
pub path: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Default)]
|
||||
pub enum HttpMethod {
|
||||
#[default]
|
||||
#[serde(rename = "GET")]
|
||||
Get,
|
||||
#[default]
|
||||
#[serde(rename = "POST")]
|
||||
Post,
|
||||
}
|
||||
|
|
@ -218,6 +212,14 @@ impl Display for HttpMethod {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct EndpointDetails {
|
||||
pub name: String,
|
||||
pub path: Option<String>,
|
||||
#[serde(rename = "http_method")]
|
||||
pub method: Option<HttpMethod>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct PromptTarget {
|
||||
pub name: String,
|
||||
|
|
|
|||
|
|
@ -940,7 +940,7 @@ impl StreamContext {
|
|||
let endpoint = prompt_target.endpoint.unwrap();
|
||||
let path: String = endpoint.path.unwrap_or(String::from("/"));
|
||||
|
||||
// only add params that are of string and number type
|
||||
// only add params that are of string, number and bool type
|
||||
let url_params = tool_params
|
||||
.iter()
|
||||
.filter(|(_, value)| value.is_number() || value.is_string() || value.is_bool())
|
||||
|
|
@ -967,7 +967,7 @@ impl StreamContext {
|
|||
}
|
||||
};
|
||||
|
||||
let http_method = prompt_target.method.unwrap_or_default().to_string();
|
||||
let http_method = endpoint.method.unwrap_or_default().to_string();
|
||||
let mut headers = vec![
|
||||
(ARCH_UPSTREAM_HOST_HEADER, endpoint.name.as_str()),
|
||||
(":method", &http_method),
|
||||
|
|
|
|||
|
|
@ -360,6 +360,7 @@ prompt_targets:
|
|||
endpoint:
|
||||
name: api_server
|
||||
path: /weather
|
||||
http_method: POST
|
||||
system_prompt: |
|
||||
You are a helpful weather forecaster. Use weater data that is provided to you. Please following following guidelines when responding to user queries:
|
||||
- Use farenheight for temperature
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue