import { APIResource } from '../../core/resource.js'; import * as ConfigsAPI from './configs.js'; import { ConfigDeleteParams, Configs } from './configs.js'; import * as TokensAPI from './tokens.js'; import { FeedbackIngestTokenCreateSchema, FeedbackIngestTokenSchema, TokenCreateParams, TokenCreateResponse, TokenListParams, TokenListResponse, TokenRetrieveParams, TokenRetrieveResponse, TokenUpdateParams, TokenUpdateResponse, Tokens } from './tokens.js'; import { APIPromise } from '../../core/api-promise.js'; import { OffsetPaginationTopLevelArray, type OffsetPaginationTopLevelArrayParams, PagePromise } from '../../core/pagination.js'; import { RequestOptions } from '../../internal/request-options.js'; export declare class Feedback extends APIResource { tokens: TokensAPI.Tokens; configs: ConfigsAPI.Configs; /** * Create a new feedback. */ create(body: FeedbackCreateParams, options?: RequestOptions): APIPromise; /** * Get a specific feedback. */ retrieve(feedbackID: string, query?: FeedbackRetrieveParams | null | undefined, options?: RequestOptions): APIPromise; /** * Replace an existing feedback entry with a new, modified entry. */ update(feedbackID: string, body: FeedbackUpdateParams, options?: RequestOptions): APIPromise; /** * List all Feedback by query params. */ list(query?: FeedbackListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Delete a feedback. */ delete(feedbackID: string, options?: RequestOptions): APIPromise; } export type FeedbackSchemasOffsetPaginationTopLevelArray = OffsetPaginationTopLevelArray; /** * API feedback source. */ export interface APIFeedbackSource { metadata?: { [key: string]: unknown; } | null; type?: 'api'; } /** * Feedback from the LangChainPlus App. */ export interface AppFeedbackSource { metadata?: { [key: string]: unknown; } | null; type?: 'app'; } /** * Auto eval feedback source. */ export interface AutoEvalFeedbackSource { metadata?: { [key: string]: unknown; } | null; type?: 'auto_eval'; } /** * Schema used for creating feedback. */ export interface FeedbackCreateSchema { key: string; id?: string; comment?: string | null; comparative_experiment_id?: string | null; correction?: { [key: string]: unknown; } | string | null; created_at?: string; error?: boolean | null; feedback_config?: FeedbackCreateSchema.FeedbackConfig | null; feedback_group_id?: string | null; /** * Feedback from the LangChainPlus App. */ feedback_source?: AppFeedbackSource | APIFeedbackSource | ModelFeedbackSource | AutoEvalFeedbackSource | null; modified_at?: string; run_id?: string | null; score?: number | boolean | null; session_id?: string | null; start_time?: string | null; trace_id?: string | null; value?: number | boolean | string | { [key: string]: unknown; } | null; } export declare namespace FeedbackCreateSchema { interface FeedbackConfig { /** * Enum for feedback types. */ type: 'continuous' | 'categorical' | 'freeform'; categories?: Array | null; max?: number | null; min?: number | null; } namespace FeedbackConfig { /** * Specific value and label pair for feedback */ interface Category { value: number; label?: string | null; } } } /** * Enum for feedback levels. */ export type FeedbackLevel = 'run' | 'session'; /** * Schema for getting feedback. */ export interface FeedbackSchema { id: string; key: string; comment?: string | null; comparative_experiment_id?: string | null; correction?: { [key: string]: unknown; } | string | null; created_at?: string; extra?: { [key: string]: unknown; } | null; feedback_group_id?: string | null; /** * The feedback source loaded from the database. */ feedback_source?: FeedbackSchema.FeedbackSource | null; feedback_thread_id?: string | null; is_root?: boolean; modified_at?: string; run_id?: string | null; score?: number | boolean | null; session_id?: string | null; start_time?: string | null; trace_id?: string | null; value?: number | boolean | string | { [key: string]: unknown; } | null; } export declare namespace FeedbackSchema { /** * The feedback source loaded from the database. */ interface FeedbackSource { ls_user_id?: string | null; metadata?: { [key: string]: unknown; } | null; type?: string | null; user_id?: string | null; user_name?: string | null; } } /** * Model feedback source. */ export interface ModelFeedbackSource { metadata?: { [key: string]: unknown; } | null; type?: 'model'; } /** * Enum for feedback source types. */ export type SourceType = 'api' | 'model' | 'app' | 'auto_eval'; export type FeedbackDeleteResponse = unknown; export interface FeedbackCreateParams { key: string; id?: string; comment?: string | null; comparative_experiment_id?: string | null; correction?: { [key: string]: unknown; } | string | null; created_at?: string; error?: boolean | null; feedback_config?: FeedbackCreateParams.FeedbackConfig | null; feedback_group_id?: string | null; /** * Feedback from the LangChainPlus App. */ feedback_source?: AppFeedbackSource | APIFeedbackSource | ModelFeedbackSource | AutoEvalFeedbackSource | null; modified_at?: string; run_id?: string | null; score?: number | boolean | null; session_id?: string | null; start_time?: string | null; trace_id?: string | null; value?: number | boolean | string | { [key: string]: unknown; } | null; } export declare namespace FeedbackCreateParams { interface FeedbackConfig { /** * Enum for feedback types. */ type: 'continuous' | 'categorical' | 'freeform'; categories?: Array | null; max?: number | null; min?: number | null; } namespace FeedbackConfig { /** * Specific value and label pair for feedback */ interface Category { value: number; label?: string | null; } } } export interface FeedbackRetrieveParams { include_user_names?: boolean | null; } export interface FeedbackUpdateParams { comment?: string | null; correction?: { [key: string]: unknown; } | string | null; feedback_config?: FeedbackUpdateParams.FeedbackConfig | null; score?: number | boolean | null; value?: number | boolean | string | { [key: string]: unknown; } | null; } export declare namespace FeedbackUpdateParams { interface FeedbackConfig { /** * Enum for feedback types. */ type: 'continuous' | 'categorical' | 'freeform'; categories?: Array | null; max?: number | null; min?: number | null; } namespace FeedbackConfig { /** * Specific value and label pair for feedback */ interface Category { value: number; label?: string | null; } } } export interface FeedbackListParams extends OffsetPaginationTopLevelArrayParams { comparative_experiment_id?: string | null; has_comment?: boolean | null; has_score?: boolean | null; include_user_names?: boolean | null; key?: Array | null; /** * Enum for feedback levels. */ level?: FeedbackLevel | null; max_created_at?: string | null; min_created_at?: string | null; run?: Array | string | null; session?: Array | string | null; source?: Array | null; user?: Array | null; } export declare namespace Feedback { export { type APIFeedbackSource as APIFeedbackSource, type AppFeedbackSource as AppFeedbackSource, type AutoEvalFeedbackSource as AutoEvalFeedbackSource, type FeedbackCreateSchema as FeedbackCreateSchema, type FeedbackLevel as FeedbackLevel, type FeedbackSchema as FeedbackSchema, type ModelFeedbackSource as ModelFeedbackSource, type SourceType as SourceType, type FeedbackDeleteResponse as FeedbackDeleteResponse, type FeedbackSchemasOffsetPaginationTopLevelArray as FeedbackSchemasOffsetPaginationTopLevelArray, type FeedbackCreateParams as FeedbackCreateParams, type FeedbackRetrieveParams as FeedbackRetrieveParams, type FeedbackUpdateParams as FeedbackUpdateParams, type FeedbackListParams as FeedbackListParams, }; export { Tokens as Tokens, type FeedbackIngestTokenCreateSchema as FeedbackIngestTokenCreateSchema, type FeedbackIngestTokenSchema as FeedbackIngestTokenSchema, type TokenCreateResponse as TokenCreateResponse, type TokenRetrieveResponse as TokenRetrieveResponse, type TokenUpdateResponse as TokenUpdateResponse, type TokenListResponse as TokenListResponse, type TokenCreateParams as TokenCreateParams, type TokenRetrieveParams as TokenRetrieveParams, type TokenUpdateParams as TokenUpdateParams, type TokenListParams as TokenListParams, }; export { Configs as Configs, type ConfigDeleteParams as ConfigDeleteParams }; }