UNPKG

@copilotkit/runtime-client-gql

Version:

<img src="https://github.com/user-attachments/assets/0a6b64d9-e193-4940-a3f6-60334ac34084" alt="banner" style="border-radius: 12px; border: 2px solid #d6d4fa;" />

40 lines (37 loc) 1.81 kB
import * as urql from 'urql'; import { OperationResultSource, OperationResult } from 'urql'; import { GenerateCopilotResponseMutationVariables, GenerateCopilotResponseMutation, Exact, GenerateCopilotResponseInput, InputMaybe, Scalars, AvailableAgentsQuery, LoadAgentStateQuery } from '../graphql/@generated/graphql.js'; import { Client } from '@urql/core'; import '@graphql-typed-document-node/core'; interface CopilotRuntimeClientOptions { url: string; publicApiKey?: string; headers?: Record<string, string>; credentials?: RequestCredentials; handleGQLErrors?: (error: Error) => void; handleGQLWarning?: (warning: string) => void; } declare class CopilotRuntimeClient { client: Client; handleGQLErrors?: (error: Error) => void; handleGQLWarning?: (warning: string) => void; constructor(options: CopilotRuntimeClientOptions); generateCopilotResponse({ data, properties, signal, }: { data: GenerateCopilotResponseMutationVariables["data"]; properties?: GenerateCopilotResponseMutationVariables["properties"]; signal?: AbortSignal; }): OperationResultSource<OperationResult<GenerateCopilotResponseMutation, Exact<{ data: GenerateCopilotResponseInput; properties?: InputMaybe<Scalars["JSONObject"]["input"]>; }>>>; asStream<S, T>(source: OperationResultSource<OperationResult<S, { data: T; }>>): ReadableStream<S>; availableAgents(): OperationResultSource<OperationResult<AvailableAgentsQuery, urql.AnyVariables>>; loadAgentState(data: { threadId: string; agentName: string; }): OperationResultSource<OperationResult<LoadAgentStateQuery, urql.AnyVariables>>; static removeGraphQLTypename(data: any): any; } export { CopilotRuntimeClient, CopilotRuntimeClientOptions };