UNPKG

venice-ai-sdk-apl

Version:

A comprehensive SDK for the Venice AI API with CLI support, programmatic CLI usage, CLI-style interface, and interactive demo

60 lines (59 loc) 1.98 kB
/** * Base Resource class * * This class serves as the base for all API resources. * It provides common functionality for making API requests. */ import { HttpClient } from '../utils/http'; import { RequestParams } from '../types/common'; /** * Base Resource class */ export declare abstract class BaseResource { /** * HTTP client for making API requests */ protected http: HttpClient; /** * Creates a new resource * * @param http - HTTP client */ constructor(http: HttpClient); /** * Makes a GET request to the API * * @param path - API path * @param query - Query parameters * @param options - Additional request options * @returns Promise that resolves with the response data */ protected get<T>(path: string, query?: Record<string, string | number | boolean | undefined>, options?: Partial<RequestParams>): Promise<T>; /** * Makes a POST request to the API * * @param path - API path * @param body - Request body * @param options - Additional request options * @returns Promise that resolves with the response data */ protected post<T>(path: string, body?: any, options?: Partial<RequestParams>): Promise<T>; /** * Makes a PUT request to the API * * @param path - API path * @param body - Request body * @param options - Additional request options * @returns Promise that resolves with the response data */ protected put<T>(path: string, body?: any, options?: Partial<RequestParams>): Promise<T>; /** * Makes a DELETE request to the API * * @param path - API path * @param query - Query parameters * @param options - Additional request options * @returns Promise that resolves with the response data */ protected delete<T>(path: string, query?: Record<string, string | number | boolean | undefined>, options?: Partial<RequestParams>): Promise<T>; }