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
13,997 changes: 13,989 additions & 8 deletions .fern/replay.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elevenlabs-cli"
version = "1.10.0"
version = "1.11.0"
edition = "2021"
description = "CLI for the ElevenLabs API"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion cli/elevenlabs/openapi0.json

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion cli/elevenlabs/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ pub fn client(ctx: &AppContext) -> elevenlabs_sdk::api::ApiClient {
conversations: elevenlabs_sdk::api::resources::agents::ConversationsClient {
http_client: http_client.clone(),
audio: elevenlabs_sdk::api::resources::agents::conversations::AudioClient { http_client: http_client.clone() },
files: elevenlabs_sdk::api::resources::agents::conversations::FilesClient { http_client: http_client.clone() },
feedback: elevenlabs_sdk::api::resources::agents::conversations::FeedbackClient { http_client: http_client.clone() },
messages: elevenlabs_sdk::api::resources::agents::conversations::MessagesClient { http_client: http_client.clone() },
tags: elevenlabs_sdk::api::resources::agents::conversations::TagsClient { http_client: http_client.clone() },
files: elevenlabs_sdk::api::resources::agents::conversations::FilesClient { http_client: http_client.clone() },
topics: elevenlabs_sdk::api::resources::agents::conversations::TopicsClient { http_client: http_client.clone() },
analysis: elevenlabs_sdk::api::resources::agents::conversations::AnalysisClient { http_client: http_client.clone() },
},
Expand Down Expand Up @@ -248,6 +248,13 @@ pub fn client(ctx: &AppContext) -> elevenlabs_sdk::api::ApiClient {
deployments: elevenlabs_sdk::api::resources::agents::DeploymentsClient { http_client: http_client.clone() },
drafts: elevenlabs_sdk::api::resources::agents::DraftsClient { http_client: http_client.clone() },
merge_proposals: elevenlabs_sdk::api::resources::agents::MergeProposalsClient { http_client: http_client.clone() },
outbound_campaigns: elevenlabs_sdk::api::resources::agents::OutboundCampaignsClient {
http_client: http_client.clone(),
config: elevenlabs_sdk::api::resources::agents::outbound_campaigns::ConfigClient { http_client: http_client.clone() },
leads: elevenlabs_sdk::api::resources::agents::outbound_campaigns::LeadsClient { http_client: http_client.clone() },
calls: elevenlabs_sdk::api::resources::agents::outbound_campaigns::CallsClient { http_client: http_client.clone() },
attention: elevenlabs_sdk::api::resources::agents::outbound_campaigns::AttentionClient { http_client: http_client.clone() },
},
procedures: elevenlabs_sdk::api::resources::agents::ProceduresClient {
http_client: http_client.clone(),
drafts: elevenlabs_sdk::api::resources::agents::procedures::DraftsClient2 { http_client: http_client.clone() },
Expand Down
2 changes: 1 addition & 1 deletion elevenlabs-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elevenlabs_sdk"
version = "1.9.0"
version = "1.11.0"
edition = "2021"
description = "Rust SDK for elevenlabs_sdk generated by Fern"
license = "MIT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ impl BatchCallsClient {
.await
}

/// Download all recipients and conversation results for a terminal batch call as CSV.
/// Download all recipients and conversation results for a batch call as CSV, including calls that are still in progress.
///
/// # Arguments
///
Expand All @@ -334,7 +334,7 @@ impl BatchCallsClient {
/// .batch_calls
/// .export(
/// &"batch_id".to_string(),
/// &ExportQueryRequest {
/// &AgentsBatchCallsExportQueryRequest {
/// ..Default::default()
/// },
/// None,
Expand All @@ -345,7 +345,7 @@ impl BatchCallsClient {
pub async fn export(
&self,
batch_id: &str,
request: &ExportQueryRequest,
request: &AgentsBatchCallsExportQueryRequest,
options: Option<RequestOptions>,
) -> Result<ByteStream, ApiError> {
self.http_client
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ impl AnalysisClient {
/// &RunConversationEvaluationsRequest {
/// evaluation_id: "evaluation_id".to_string(),
/// scope: None,
/// evaluated_agent_id: None,
/// evaluated_branch_id: None,
/// },
/// None,
/// )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::api::*;
use crate::{ApiError, ClientConfig, HttpClient, RequestOptions};
use crate::{ApiError, ByteStream, ClientConfig, HttpClient, RequestOptions};
use reqwest::Method;

pub struct FilesClient {
Expand All @@ -13,15 +13,17 @@ impl FilesClient {
})
}

/// Upload an image, PDF, or text file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation.
/// Download a file the user attached to a conversation, including while the conversation is still active.
///
/// # Arguments
///
/// * `conversation_id` - The id of the conversation you're taking the action on.
/// * `file_id` - The file ID returned when it was uploaded.
/// * `options` - Additional request options such as headers, timeout, etc.
///
/// # Returns
///
/// JSON response from the API
/// Streaming file download (use .into_bytes() to collect or stream chunks)
///
/// # Examples
///
Expand All @@ -38,27 +40,24 @@ impl FilesClient {
/// .agents
/// .conversations
/// .files
/// .create(
/// &"conversation_id".to_string(),
/// &CreateRequest6 {
/// file: b"test file content".to_vec(),
/// },
/// None,
/// )
/// .get(&"conversation_id".to_string(), &"file_id".to_string(), None)
/// .await;
/// }
/// ```
pub async fn create(
pub async fn get(
&self,
conversation_id: &str,
request: &CreateRequest,
file_id: &str,
options: Option<RequestOptions>,
) -> Result<ConvAiFileUploadResponseModel, ApiError> {
) -> Result<ByteStream, ApiError> {
self.http_client
.execute_multipart_request(
Method::POST,
&format!("v1/convai/conversations/{}/files", conversation_id),
request.clone().to_multipart(),
.execute_stream_request(
Method::GET,
&format!(
"v1/convai/conversations/{}/files/{}",
conversation_id, file_id
),
None,
None,
options,
)
Expand Down Expand Up @@ -113,4 +112,56 @@ impl FilesClient {
)
.await
}

/// Upload an image, PDF, or text file for a conversation. Returns a unique file ID that can be used to reference the file in the conversation.
///
/// # Arguments
///
/// * `options` - Additional request options such as headers, timeout, etc.
///
/// # Returns
///
/// JSON response from the API
///
/// # Examples
///
/// ```no_run
/// use elevenlabs_sdk::prelude::*;
///
/// #[tokio::main]
/// async fn main() {
/// let config = ClientConfig {
/// ..Default::default()
/// };
/// let client = ElevenlabsClient::new(config).expect("Failed to build client");
/// client
/// .agents
/// .conversations
/// .files
/// .create(
/// &"conversation_id".to_string(),
/// &CreateRequest6 {
/// file: b"test file content".to_vec(),
/// },
/// None,
/// )
/// .await;
/// }
/// ```
pub async fn create(
&self,
conversation_id: &str,
request: &CreateRequest,
options: Option<RequestOptions>,
) -> Result<ConvAiFileUploadResponseModel, ApiError> {
self.http_client
.execute_multipart_request(
Method::POST,
&format!("v1/convai/conversations/{}/files", conversation_id),
request.clone().to_multipart(),
None,
options,
)
.await
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ impl MessagesClient {
/// * `tool_names` - Filter conversations by tool names used during the call.
/// * `tool_names_successful` - Filter conversations by tool names that had successful calls.
/// * `tool_names_errored` - Filter conversations by tool names that had errored calls.
/// * `tool_ids` - Filter conversations by IDs of tools used during the call. Use '__system_<tool_name>' for system tools. Unlike tool_names, distinguishes between tools that share a name.
/// * `tool_ids_successful` - Filter conversations by IDs of tools that had successful calls.
/// * `tool_ids_errored` - Filter conversations by IDs of tools that had errored calls.
/// * `include_invalid_tool_calls` - Also match tool calls that never ran.
/// * `main_languages` - Filter conversations by detected main language (language code).
/// * `phone_number_ids` - Filter conversations by agent phone number IDs.
/// * `whatsapp_phone_number_ids` - Filter conversations by agent WhatsApp number IDs.
/// * `exclude_statuses` - Exclude conversations with the given statuses. Useful for hiding in-progress / processing conversations from list views.
/// * `termination_reasons` - Filter conversations by their stored termination_reason (metadata.termination_reason). Repeat param to match any of several.
/// * `page_size` - Number of results per page. Max 50.
Expand Down Expand Up @@ -92,8 +97,13 @@ impl MessagesClient {
/// tool_names: vec![Some("tool_names".to_string())],
/// tool_names_successful: vec![Some("tool_names_successful".to_string())],
/// tool_names_errored: vec![Some("tool_names_errored".to_string())],
/// tool_ids: vec![Some("tool_ids".to_string())],
/// tool_ids_successful: vec![Some("tool_ids_successful".to_string())],
/// tool_ids_errored: vec![Some("tool_ids_errored".to_string())],
/// include_invalid_tool_calls: Some(true),
/// main_languages: vec![Some("main_languages".to_string())],
/// phone_number_ids: vec![Some("phone_number_ids".to_string())],
/// whatsapp_phone_number_ids: vec![Some("whatsapp_phone_number_ids".to_string())],
/// exclude_statuses: vec![Some(
/// MessagesTextSearchRequestExcludeStatusesItem::Initiated,
/// )],
Expand Down Expand Up @@ -172,11 +182,19 @@ impl MessagesClient {
request.tool_names_successful.clone(),
)
.string_array("tool_names_errored", request.tool_names_errored.clone())
.string_array("tool_ids", request.tool_ids.clone())
.string_array("tool_ids_successful", request.tool_ids_successful.clone())
.string_array("tool_ids_errored", request.tool_ids_errored.clone())
.bool(
"include_invalid_tool_calls",
request.include_invalid_tool_calls.clone(),
)
.string_array("main_languages", request.main_languages.clone())
.string_array("phone_number_ids", request.phone_number_ids.clone())
.string_array(
"whatsapp_phone_number_ids",
request.whatsapp_phone_number_ids.clone(),
)
.serialize_array("exclude_statuses", request.exclude_statuses.clone())
.string_array("termination_reasons", request.termination_reasons.clone())
.int("page_size", request.page_size.clone())
Expand Down
Loading
Loading