mirror of
https://github.com/katanemo/plano.git
synced 2026-07-05 15:52:12 +02:00
add messages in params when making api calls (#104)
This commit is contained in:
parent
f4395d39f9
commit
15869825e3
4 changed files with 11 additions and 5 deletions
|
|
@ -9,3 +9,4 @@ pub const ARC_FC_CLUSTER: &str = "arch_fc";
|
||||||
pub const ARCH_FC_REQUEST_TIMEOUT_MS: u64 = 120000; // 2 minutes
|
pub const ARCH_FC_REQUEST_TIMEOUT_MS: u64 = 120000; // 2 minutes
|
||||||
pub const MODEL_SERVER_NAME: &str = "model_server";
|
pub const MODEL_SERVER_NAME: &str = "model_server";
|
||||||
pub const ARCH_ROUTING_HEADER: &str = "x-arch-llm-provider";
|
pub const ARCH_ROUTING_HEADER: &str = "x-arch-llm-provider";
|
||||||
|
pub const ARCH_MESSAGES_KEY: &str = "arch_messages";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::consts::{
|
use crate::consts::{
|
||||||
ARCH_FC_REQUEST_TIMEOUT_MS, ARCH_ROUTING_HEADER, ARC_FC_CLUSTER, DEFAULT_EMBEDDING_MODEL,
|
ARCH_FC_REQUEST_TIMEOUT_MS, ARCH_MESSAGES_KEY, ARCH_ROUTING_HEADER, ARC_FC_CLUSTER,
|
||||||
DEFAULT_INTENT_MODEL, DEFAULT_PROMPT_TARGET_THRESHOLD, GPT_35_TURBO, MODEL_SERVER_NAME,
|
DEFAULT_EMBEDDING_MODEL, DEFAULT_INTENT_MODEL, DEFAULT_PROMPT_TARGET_THRESHOLD, GPT_35_TURBO,
|
||||||
RATELIMIT_SELECTOR_HEADER_KEY, SYSTEM_ROLE, USER_ROLE,
|
MODEL_SERVER_NAME, RATELIMIT_SELECTOR_HEADER_KEY, SYSTEM_ROLE, USER_ROLE,
|
||||||
};
|
};
|
||||||
use crate::filter_context::{embeddings_store, WasmMetrics};
|
use crate::filter_context::{embeddings_store, WasmMetrics};
|
||||||
use crate::llm_providers::{LlmProvider, LlmProviders};
|
use crate::llm_providers::{LlmProvider, LlmProviders};
|
||||||
|
|
@ -507,7 +507,11 @@ impl StreamContext {
|
||||||
callout_context.similarity_scores
|
callout_context.similarity_scores
|
||||||
);
|
);
|
||||||
//HACK: for now we only support one tool call, we will support multiple tool calls in the future
|
//HACK: for now we only support one tool call, we will support multiple tool calls in the future
|
||||||
let tool_params = &tool_calls[0].function.arguments;
|
let mut tool_params = tool_calls[0].function.arguments.clone();
|
||||||
|
tool_params.insert(
|
||||||
|
String::from(ARCH_MESSAGES_KEY),
|
||||||
|
serde_yaml::to_value(&callout_context.request_body.messages).unwrap(),
|
||||||
|
);
|
||||||
let tools_call_name = tool_calls[0].function.name.clone();
|
let tools_call_name = tool_calls[0].function.name.clone();
|
||||||
let tool_params_json_str = serde_json::to_string(&tool_params).unwrap();
|
let tool_params_json_str = serde_json::to_string(&tool_params).unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,7 @@ prompt_targets:
|
||||||
system_prompt: |
|
system_prompt: |
|
||||||
You are a helpful insurance claim details provider. Use insurance claim data that is provided to you. Please following following guidelines when responding to user queries:
|
You are a helpful insurance claim details provider. Use insurance claim data that is provided to you. Please following following guidelines when responding to user queries:
|
||||||
- Use policy number to retrieve insurance claim details
|
- Use policy number to retrieve insurance claim details
|
||||||
|
|
||||||
ratelimits:
|
ratelimits:
|
||||||
- provider: gpt-3.5-turbo
|
- provider: gpt-3.5-turbo
|
||||||
selector:
|
selector:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use std::{collections::HashMap, time::Duration};
|
use std::{collections::HashMap, time::Duration};
|
||||||
|
|
||||||
use duration_string::DurationString;
|
use duration_string::DurationString;
|
||||||
use serde::{Deserialize, Serialize, Deserializer};
|
use serde::{Deserialize, Deserializer, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||||
pub struct Overrides {
|
pub struct Overrides {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue