-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessages.ts
More file actions
77 lines (66 loc) · 2.03 KB
/
messages.ts
File metadata and controls
77 lines (66 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class Messages extends APIResource {
/**
* Clear all messages from a given agent session.
*/
clear(params: MessageClearParams, options?: RequestOptions): APIPromise<MessageClearResponse> {
const { session } = params;
return this._client.post('/clear-messages', { query: { session }, ...options });
}
/**
* Retrieve the entire message history for a given agent session.
* Messages include user messages, the agent’s internal thoughts, agent responses,
* and tool usage records.
*/
get(params: MessageGetParams, options?: RequestOptions): APIPromise<MessageGetResponse> {
const { session } = params;
return this._client.post('/get-messages', { query: { session }, ...options });
}
}
export interface MessageClearResponse {
/**
* Human‑readable status message.
*/
message?: string;
/**
* Indicates whether messages were successfully cleared.
*/
success?: boolean;
}
export type MessageGetResponse = Array<MessageGetResponse.MessageGetResponseItem>;
export namespace MessageGetResponse {
export interface MessageGetResponseItem {
/**
* The textual content of the message.
*/
content: string;
/**
* Type of the message (e.g., user_message, agent_thinking, agent_response,
* agent_tool_use).
*/
type: string;
}
}
export interface MessageClearParams {
/**
* The session ID to clear messages from.
*/
session: string;
}
export interface MessageGetParams {
/**
* The session ID to retrieve messages from.
*/
session: string;
}
export declare namespace Messages {
export {
type MessageClearResponse as MessageClearResponse,
type MessageGetResponse as MessageGetResponse,
type MessageClearParams as MessageClearParams,
type MessageGetParams as MessageGetParams,
};
}