Skip to main content

roark_rs/models/
tool_invocation.rs

1/*
2 * Roark Analytics API
3 *
4 * # Roark Analytics API - Voice AI Analytics Platform  The Roark Analytics API provides comprehensive monitoring, evaluation, and analytics capabilities for voice AI agents. This API allows developers to seamlessly integrate with the Roark platform to track call quality, analyze agent performance, and extract insights from voice interactions.  ## Key Features  - **Real-time Call Analysis**: Upload and analyze voice call recordings with AI-powered insights - **Sentiment Analysis**: Extract emotional tone, key phrases, and sentiment scores across 64+ emotions - **Agent Performance Evaluation**: Create custom evaluation jobs with configurable metrics and scoring - **Platform Integrations**: Native support for VAPI and Retell AI with webhook-based data ingestion - **Custom Analytics**: Build custom analytics pipelines with flexible data models and properties  ## Authentication  All API endpoints require Bearer token authentication. Include your API token in the Authorization header:  ``` Authorization: Bearer YOUR_API_TOKEN ```  ## Rate Limiting  The API implements rate limiting to ensure service stability. Rate limit headers are included in responses.  ## Error Handling  The API uses standard HTTP status codes and returns structured error responses with detailed error information including error types, codes, and human-readable messages.  ## Rust Code Generation  This OpenAPI specification has been optimized for Rust code generation with: - Snake_case field naming conventions - Proper nullable field handling with Option<T> - Comprehensive documentation for generated code - Type-safe enum definitions - Structured error handling
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * Contact: support@roark.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ToolInvocation : Details of a tool or function invocation during a call
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ToolInvocation {
17    /// Name identifier of the invoked tool or function
18    #[serde(rename = "name")]
19    pub name: String,
20    /// Human-readable description of the tool's purpose
21    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
22    pub description: Option<String>,
23    /// Parameters provided to the tool during invocation
24    #[serde(rename = "parameters")]
25    pub parameters: std::collections::HashMap<String, models::ToolInvocationParametersValue>,
26    #[serde(rename = "result")]
27    pub result: models::ToolInvocationResult,
28    /// Offset in milliseconds from call start when tool was invoked
29    #[serde(rename = "start_offset_ms")]
30    pub start_offset_ms: u32,
31    /// Offset in milliseconds from call start when tool execution completed
32    #[serde(rename = "end_offset_ms", skip_serializing_if = "Option::is_none")]
33    pub end_offset_ms: Option<u32>,
34}
35
36impl ToolInvocation {
37    /// Details of a tool or function invocation during a call
38    pub fn new(name: String, parameters: std::collections::HashMap<String, models::ToolInvocationParametersValue>, result: models::ToolInvocationResult, start_offset_ms: u32) -> ToolInvocation {
39        ToolInvocation {
40            name,
41            description: None,
42            parameters,
43            result,
44            start_offset_ms,
45            end_offset_ms: None,
46        }
47    }
48}
49