Skip to content

Commit 7d205fd

Browse files
Copilotoleander
andcommitted
Rename functions in src/openai.rs to follow naming conventions
Co-authored-by: oleander <220827+oleander@users.noreply.github.com>
1 parent b295d44 commit 7d205fd

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub async fn call(request: Request) -> Result<Response> {
2626
model: request.model
2727
};
2828

29-
let response = openai::call(openai_request).await?;
29+
let response = openai::generate_with_openai(openai_request).await?;
3030
Ok(Response { response: response.response })
3131
}
3232

src/commit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,13 @@ pub async fn generate(patch: String, remaining_tokens: usize, model: Model, sett
183183
Some(custom_settings) => {
184184
// Create a client with custom settings
185185
match openai::create_openai_config(custom_settings) {
186-
Ok(config) => openai::call_with_config(request, config).await,
186+
Ok(config) => openai::generate_with_config(request, config).await,
187187
Err(e) => Err(e)
188188
}
189189
}
190190
None => {
191191
// Use the default global config
192-
openai::call(request).await
192+
openai::generate_with_openai(request).await
193193
}
194194
}
195195
}

src/openai.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ fn truncate_to_fit(text: &str, max_tokens: usize, model: &Model) -> Result<Strin
197197
}
198198
}
199199

200-
/// Calls the OpenAI API with the provided configuration
201-
pub async fn call_with_config(request: Request, config: OpenAIConfig) -> Result<Response> {
200+
/// Generate with OpenAI using provided configuration
201+
pub async fn generate_with_config(request: Request, config: OpenAIConfig) -> Result<Response> {
202202
profile!("OpenAI API call with custom config");
203203

204204
// Always try multi-step approach first (it's now the default)
@@ -377,13 +377,13 @@ pub async fn call_with_config(request: Request, config: OpenAIConfig) -> Result<
377377
}
378378
}
379379

380-
/// Calls the OpenAI API with default configuration from settings
381-
pub async fn call(request: Request) -> Result<Response> {
380+
/// Generate with OpenAI using default configuration from settings
381+
pub async fn generate_with_openai(request: Request) -> Result<Response> {
382382
profile!("OpenAI API call");
383383

384384
// Create OpenAI configuration using our settings
385385
let config = create_openai_config(&config::APP_CONFIG)?;
386386

387-
// Use the call_with_config function with the default config
388-
call_with_config(request, config).await
387+
// Use the generate_with_config function with the default config
388+
generate_with_config(request, config).await
389389
}

0 commit comments

Comments
 (0)