@humanlayer/sdk
Version:
typescript client for humanlayer.dev
38 lines (37 loc) • 1.74 kB
TypeScript
import { AgentBackend, AgentStore } from './protocol';
import { Escalation, FunctionCall, FunctionCallStatus, HumanContact, HumanContactStatus } from './models';
declare class HumanLayerCloudConnection {
apiKey?: string;
apiBaseURL?: string;
constructor(api_key?: string, api_base_url?: string);
request({ method, path, body, }: {
method: string;
path: string;
body?: any;
}): Promise<Response>;
}
declare class CloudFunctionCallStore implements AgentStore<FunctionCall, FunctionCallStatus> {
private connection;
constructor(connection: HumanLayerCloudConnection);
add(item: FunctionCall): Promise<FunctionCall>;
get(call_id: string): Promise<FunctionCall>;
respond(call_id: string, status: FunctionCallStatus): Promise<FunctionCall>;
escalateEmail(call_id: string, escalation: Escalation): Promise<FunctionCall>;
}
declare class CloudHumanContactStore implements AgentStore<HumanContact, HumanContactStatus> {
private connection;
constructor(connection: HumanLayerCloudConnection);
add(item: HumanContact): Promise<HumanContact>;
get(call_id: string): Promise<HumanContact>;
respond(call_id: string, status: HumanContactStatus): Promise<HumanContact>;
escalateEmail(call_id: string, escalation: Escalation): Promise<HumanContact>;
}
declare class CloudHumanLayerBackend implements AgentBackend {
connection: HumanLayerCloudConnection;
private _function_calls;
private _human_contacts;
constructor(connection: HumanLayerCloudConnection);
functions(): CloudFunctionCallStore;
contacts(): CloudHumanContactStore;
}
export { HumanLayerCloudConnection, CloudFunctionCallStore, CloudHumanContactStore, CloudHumanLayerBackend, };