Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "allms"
version = "0.35.1"
version = "0.35.2"
edition = "2021"
authors = [
"Kamil Litman <[email protected]>",
Expand Down
8 changes: 8 additions & 0 deletions src/assistants/openai/openai_assistant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ impl OpenAIAssistant {
.version
.get_endpoint(&OpenAIAssistantResource::Assistants);

// If debug is true, print the URL
if self.debug {
info!(
"[debug] OpenAI Assistant Create API URL: {:#?}",
assistant_url
);
}

//Get the version-specific header
let version_headers = self.version.get_headers(&self.api_key);

Expand Down
8 changes: 8 additions & 0 deletions src/assistants/openai/openai_vector_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ impl OpenAIVectorStore {
.version
.get_endpoint(&OpenAIAssistantResource::VectorStores);

// If debug is true, print the URL
if self.debug {
info!(
"[debug] OpenAI Vector Store Create API URL: {:#?}",
vector_store_url
);
}

//Make the API call
let client = Client::new();

Expand Down
5 changes: 5 additions & 0 deletions src/files/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ impl LLMFiles for OpenAIFile {
async fn upload(mut self, file_name: &str, file_bytes: Vec<u8>) -> Result<Self> {
let files_url = self.version.get_endpoint(&OpenAIAssistantResource::Files);

// If debug is true, print the URL
if self.debug {
info!("[debug] OpenAI Files Upload API URL: {:#?}", files_url);
}

// This API sends a form so content type is automatically set by multipart method
let mut version_headers = self.version.get_headers(&self.api_key);
version_headers.remove(header::CONTENT_TYPE);
Expand Down
4 changes: 4 additions & 0 deletions src/llm_models/anthropic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ impl LLMModel for AnthropicModels {
//Get the API url
let model_url = self.get_endpoint();

if debug {
info!("[debug] Anthropic API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down
6 changes: 6 additions & 0 deletions src/llm_models/aws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ impl LLMModel for AwsBedrockModels {
.region(&**AWS_REGION)
.load()
.await;

// If debug is true, print the SDK config
if debug {
info!("[debug] AWS Bedrock SDK config: {:#?}", sdk_config);
}

let client = Client::new(&sdk_config);

// Get request info from body
Expand Down
4 changes: 4 additions & 0 deletions src/llm_models/deepseek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ impl LLMModel for DeepSeekModels {
//Get the API url
let model_url = self.get_endpoint();

if debug {
info!("[debug] DeepSeek API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down
15 changes: 15 additions & 0 deletions src/llm_models/google.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,10 @@ impl GoogleModels {
//Get the API url
let model_url = self.get_version_endpoint(version);

if debug {
info!("[debug] Google AI Studio API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down Expand Up @@ -637,6 +641,13 @@ impl GoogleModels {
//Get the API url
let model_url = self.get_version_endpoint(version);

if debug {
info!(
"[debug] Google Vertex API URL (streaming): {:#?}",
model_url
);
}

//Make the API call
let client = Client::new();

Expand Down Expand Up @@ -716,6 +727,10 @@ impl GoogleModels {
//Get the API url
let model_url = self.get_version_endpoint(version);

if debug {
info!("[debug] Google Vertex API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down
4 changes: 4 additions & 0 deletions src/llm_models/mistral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ impl LLMModel for MistralModels {
self.get_endpoint()
};

if debug {
info!("[debug] Mistral API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down
5 changes: 5 additions & 0 deletions src/llm_models/openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,11 @@ impl LLMModel for OpenAIModels {
//Get the API url
let model_url = self.get_version_endpoint(version);

// If debug is true, print the body
if debug {
info!("[debug] OpenAI API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down
4 changes: 4 additions & 0 deletions src/llm_models/perplexity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ impl LLMModel for PerplexityModels {
//Get the API url
let model_url = self.get_endpoint();

if debug {
info!("[debug] Perplexity API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down
4 changes: 4 additions & 0 deletions src/llm_models/xai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ impl LLMModel for XAIModels {
//Get the API url
let model_url = self.get_endpoint();

if debug {
info!("[debug] xAI API URL: {:#?}", model_url);
}

//Make the API call
let client = Client::new();

Expand Down