don't compute embeddings for names and other fixes see description (#126)

* serialize tools - 2

* fix int tests

* fix int test

* fix unit tests
This commit is contained in:
Adil Hafeez 2024-10-05 19:25:16 -07:00 committed by GitHub
parent 0e5ea3d6db
commit 2a747df7c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 125 additions and 86 deletions

View file

@ -12,3 +12,4 @@ pub const ARCH_ROUTING_HEADER: &str = "x-arch-llm-provider";
pub const ARCH_MESSAGES_KEY: &str = "arch_messages";
pub const ARCH_PROVIDER_HINT_HEADER: &str = "x-arch-llm-provider-hint";
pub const CHAT_COMPLETIONS_PATH: &str = "v1/chat/completions";
// pub const ARCH_STATE_HEADER: &str = "x-arch-state";

View file

@ -72,11 +72,6 @@ impl FilterContext {
fn process_prompt_targets(&self) {
for values in self.prompt_targets.iter() {
let prompt_target = values.1;
self.schedule_embeddings_call(
&prompt_target.name,
&prompt_target.name,
EmbeddingType::Name,
);
self.schedule_embeddings_call(
&prompt_target.name,
&prompt_target.description,

View file

@ -65,7 +65,7 @@ pub trait Client: Context {
}
Err(status) => Err(ClientError::DispatchError {
upstream_name: String::from(call_args.upstream),
internal_status: status.clone(),
internal_status: status,
}),
}
}

View file

@ -469,6 +469,7 @@ impl StreamContext {
tools: Some(chat_completion_tools),
stream: false,
stream_options: None,
metadata: None,
};
let msg_body = match serde_json::to_string(&chat_completions) {
@ -686,6 +687,7 @@ impl StreamContext {
tools: None,
stream: callout_context.request_body.stream,
stream_options: callout_context.request_body.stream_options,
metadata: None,
};
let json_string = match serde_json::to_string(&chat_completions_request) {
@ -875,6 +877,7 @@ impl StreamContext {
tools: None,
stream: callout_context.request_body.stream,
stream_options: callout_context.request_body.stream_options,
metadata: None,
};
let json_resp = serde_json::to_string(&chat_completion_request).unwrap();
debug!("sending response back to default llm: {}", json_resp);