Skip to content
0

katanakit-js / IAssistantService

Interface: IAssistantService ​

Defined in: src/types/index.ts:918

Contract of the assistant facade.

Methods ​

useCreateSession() ​

ts
useCreateSession(channel?): Promise<string>;

Defined in: src/types/index.ts:925

Parameters ​

ParameterType
channel?string

Returns ​

Promise<string>


useGetHistory() ​

ts
useGetHistory(sessionId): Promise<{
  content: string | null;
  name?: string;
  role: "system" | "user" | "assistant" | "tool";
  tool_call_id?: string;
  tool_calls?: {
     function: {
        arguments: string;
        name: string;
     };
     id: string;
     type: "function";
  }[];
}[]>;

Defined in: src/types/index.ts:927

Parameters ​

ParameterType
sessionIdstring

Returns ​

Promise<{ content: string | null; name?: string; role: "system" | "user" | "assistant" | "tool"; tool_call_id?: string; tool_calls?: { function: { arguments: string; name: string; }; id: string; type: "function"; }[]; }[]>


useInitAssistant() ​

ts
useInitAssistant(config?): void;

Defined in: src/types/index.ts:919

Parameters ​

ParameterType
config?AssistantInitConfig

Returns ​

void


useReply() ​

ts
useReply(
   sessionId, 
   text, 
   options?
): Promise<AssistantResult>;

Defined in: src/types/index.ts:920

Parameters ​

ParameterType
sessionIdstring | undefined
textstring
options?AssistantReplyOptions

Returns ​

Promise<AssistantResult>


useResetSession() ​

ts
useResetSession(sessionId): Promise<void>;

Defined in: src/types/index.ts:928

Parameters ​

ParameterType
sessionIdstring

Returns ​

Promise<void>


useSessionExists() ​

ts
useSessionExists(sessionId): Promise<boolean>;

Defined in: src/types/index.ts:926

Parameters ​

ParameterType
sessionIdstring

Returns ​

Promise<boolean>

Released under the MIT License.