mirror of
https://github.com/openai/codex.git
synced 2026-04-30 01:16:54 +00:00
Reuse websocket connection (#9127)
Reuses the connection but still sends full requests.
This commit is contained in:
@@ -88,7 +88,7 @@ async fn run_request(input: Vec<ResponseItem>) -> Value {
|
||||
SessionSource::Exec,
|
||||
);
|
||||
|
||||
let client = ModelClient::new(
|
||||
let mut client_session = ModelClient::new(
|
||||
Arc::clone(&config),
|
||||
None,
|
||||
model_info,
|
||||
@@ -104,7 +104,7 @@ async fn run_request(input: Vec<ResponseItem>) -> Value {
|
||||
let mut prompt = Prompt::default();
|
||||
prompt.input = input;
|
||||
|
||||
let mut stream = match client.stream(&prompt).await {
|
||||
let mut stream = match client_session.stream(&prompt).await {
|
||||
Ok(s) => s,
|
||||
Err(e) => panic!("stream chat failed: {e}"),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user