Break apart common_types mod (#334)

Signed-off-by: José Ulises Niño Rivera <junr03@users.noreply.github.com>
This commit is contained in:
José Ulises Niño Rivera 2024-12-06 17:25:42 -08:00 committed by GitHub
parent 93d3d349a2
commit d002b2042a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 764 additions and 783 deletions

View file

@ -1,10 +1,8 @@
use crate::stream_context::{ResponseHandlerType, StreamCallContext, StreamContext};
use common::{
common_types::{
open_ai::{
to_server_events, ArchState, ChatCompletionStreamResponse, ChatCompletionsRequest,
},
PromptGuardRequest, PromptGuardTask,
api::{
open_ai::{self, ArchState, ChatCompletionStreamResponse, ChatCompletionsRequest},
prompt_guard::{PromptGuardRequest, PromptGuardTask},
},
consts::{
ARCH_FC_MODEL_NAME, ARCH_INTERNAL_CLUSTER_NAME, ARCH_STATE_HEADER,
@ -324,7 +322,7 @@ impl HttpContext for StreamContext {
),
];
let mut response_str = to_server_events(chunks);
let mut response_str = open_ai::to_server_events(chunks);
// append the original response from the model to the stream
response_str.push_str(&body_utf8);
self.set_http_response_body(0, body_size, response_str.as_bytes());