@amigo-ai/sdk 0.100.0 → 0.100.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/dist/index.cjs +14 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +14 -2
- package/dist/index.mjs.map +2 -2
- package/dist/types/core/openapi-client.d.ts +1 -0
- package/dist/types/core/retry.d.ts +2 -0
- package/dist/types/generated/api-types.d.ts +1634 -807
- package/dist/types/index.d.ts +5 -0
- package/dist/types/resources/conversation.d.ts +10 -0
- package/dist/types/resources/organization.d.ts +2 -1
- package/dist/types/resources/services.d.ts +1 -0
- package/dist/types/resources/user.d.ts +6 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -17,12 +17,17 @@ export interface AmigoSdkConfig {
|
|
|
17
17
|
/** Retry configuration for HTTP requests */
|
|
18
18
|
retry?: RetryOptions;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Main client for the Amigo API.
|
|
22
|
+
* Provides access to all API resources (organizations, conversations, services, users).
|
|
23
|
+
*/
|
|
20
24
|
export declare class AmigoClient {
|
|
21
25
|
readonly organizations: OrganizationResource;
|
|
22
26
|
readonly conversations: ConversationResource;
|
|
23
27
|
readonly services: ServiceResource;
|
|
24
28
|
readonly users: UserResource;
|
|
25
29
|
readonly config: AmigoSdkConfig;
|
|
30
|
+
/** Create a new Amigo client with the given configuration. */
|
|
26
31
|
constructor(config: AmigoSdkConfig);
|
|
27
32
|
}
|
|
28
33
|
export * as errors from './core/errors';
|
|
@@ -2,10 +2,12 @@ import type { AmigoFetch } from '../core/openapi-client';
|
|
|
2
2
|
import type { components, operations } from '../generated/api-types';
|
|
3
3
|
type VoiceData = Blob | Uint8Array | ReadableStream<Uint8Array>;
|
|
4
4
|
export type InteractionInput = string | VoiceData;
|
|
5
|
+
/** Resource for managing conversations and interactions. */
|
|
5
6
|
export declare class ConversationResource {
|
|
6
7
|
private c;
|
|
7
8
|
private orgId;
|
|
8
9
|
constructor(c: AmigoFetch, orgId: string);
|
|
10
|
+
/** Create a new conversation and return an async stream of NDJSON events. */
|
|
9
11
|
createConversation(body: components['schemas']['conversation__create_conversation__Request'], queryParams: operations['create-conversation']['parameters']['query'], headers?: operations['create-conversation']['parameters']['header'], options?: {
|
|
10
12
|
signal?: AbortSignal;
|
|
11
13
|
}): Promise<AsyncGenerator<{
|
|
@@ -32,6 +34,7 @@ export declare class ConversationResource {
|
|
|
32
34
|
http_error_code: number;
|
|
33
35
|
error_description: string;
|
|
34
36
|
}, any, any>>;
|
|
37
|
+
/** Send a text or voice interaction and return an async stream of NDJSON events. */
|
|
35
38
|
interactWithConversation(conversationId: string, input: InteractionInput, queryParams: operations['interact-with-conversation']['parameters']['query'], headers?: operations['interact-with-conversation']['parameters']['header'], options?: {
|
|
36
39
|
signal?: AbortSignal;
|
|
37
40
|
}): Promise<AsyncGenerator<{
|
|
@@ -59,22 +62,27 @@ export declare class ConversationResource {
|
|
|
59
62
|
message_id: string;
|
|
60
63
|
user_message: string;
|
|
61
64
|
}, any, any>>;
|
|
65
|
+
/** List conversations, optionally filtered by query parameters. */
|
|
62
66
|
getConversations(queryParams?: operations['get-conversations']['parameters']['query'], headers?: operations['get-conversations']['parameters']['header']): Promise<{
|
|
63
67
|
conversations: components["schemas"]["ConversationInstance"][];
|
|
64
68
|
has_more: boolean;
|
|
65
69
|
continuation_token: number | null;
|
|
66
70
|
}>;
|
|
71
|
+
/** Get messages for a conversation. */
|
|
67
72
|
getConversationMessages(conversationId: string, queryParams?: operations['get-conversation-messages']['parameters']['query'], headers?: operations['get-conversation-messages']['parameters']['header']): Promise<{
|
|
68
73
|
messages: components["schemas"]["MessageInstance"][];
|
|
69
74
|
has_more: boolean;
|
|
70
75
|
continuation_token: number | null;
|
|
71
76
|
}>;
|
|
77
|
+
/** Finish (close) a conversation. */
|
|
72
78
|
finishConversation(conversationId: string, headers?: operations['finish-conversation']['parameters']['header']): Promise<void>;
|
|
79
|
+
/** Get recommended responses for an interaction. */
|
|
73
80
|
recommendResponsesForInteraction(conversationId: string, interactionId: string, body?: {
|
|
74
81
|
context?: string;
|
|
75
82
|
}, headers?: operations['recommend-responses-for-interaction']['parameters']['header']): Promise<{
|
|
76
83
|
recommended_responses: string[];
|
|
77
84
|
}>;
|
|
85
|
+
/** Get insights for an interaction. */
|
|
78
86
|
getInteractionInsights(conversationId: string, interactionId: string, headers?: operations['get-interaction-insights']['parameters']['header']): Promise<{
|
|
79
87
|
current_state_name: string;
|
|
80
88
|
current_state_action: string;
|
|
@@ -86,7 +94,9 @@ export declare class ConversationResource {
|
|
|
86
94
|
select_next_action_tool_call_logs: components["schemas"]["ToolCallLog"][][];
|
|
87
95
|
engage_user_tool_call_logs: components["schemas"]["ToolCallLog"][][];
|
|
88
96
|
}>;
|
|
97
|
+
/** Get the audio/media source URL for a message. */
|
|
89
98
|
getMessageSource(conversationId: string, messageId: string, headers?: operations['retrieve-message-source']['parameters']['header']): Promise<{}>;
|
|
99
|
+
/** Generate conversation starter suggestions. */
|
|
90
100
|
generateConversationStarters(body: components['schemas']['conversation__generate_conversation_starter__Request'], headers?: operations['generate-conversation-starter']['parameters']['header']): Promise<{
|
|
91
101
|
prompts: components["schemas"]["Prompt"][];
|
|
92
102
|
}>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AmigoFetch } from '../core/openapi-client';
|
|
2
2
|
import type { operations } from '../generated/api-types';
|
|
3
|
+
/** Resource for retrieving organization details. */
|
|
3
4
|
export declare class OrganizationResource {
|
|
4
5
|
private c;
|
|
5
6
|
private orgId;
|
|
@@ -16,6 +17,6 @@ export declare class OrganizationResource {
|
|
|
16
17
|
main_description: string;
|
|
17
18
|
sub_description: string;
|
|
18
19
|
onboarding_instructions: string[];
|
|
19
|
-
default_user_preferences: import("..").components["schemas"]["
|
|
20
|
+
default_user_preferences: import("..").components["schemas"]["Preferences-Output"] | null;
|
|
20
21
|
}>;
|
|
21
22
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import type { AmigoFetch } from '../core/openapi-client';
|
|
2
2
|
import type { components, operations } from '../generated/api-types';
|
|
3
|
+
/** Resource for managing users in the organization. */
|
|
3
4
|
export declare class UserResource {
|
|
4
5
|
private c;
|
|
5
6
|
private orgId;
|
|
6
7
|
constructor(c: AmigoFetch, orgId: string);
|
|
8
|
+
/** List users in the organization. */
|
|
7
9
|
getUsers(queryParams?: operations['get-users']['parameters']['query'], headers?: operations['get-users']['parameters']['header']): Promise<{
|
|
8
|
-
users: components["schemas"]["
|
|
10
|
+
users: components["schemas"]["UserInstance"][];
|
|
9
11
|
has_more: boolean;
|
|
10
12
|
continuation_token: number | null;
|
|
11
13
|
}>;
|
|
14
|
+
/** Create (invite) a new user to the organization. */
|
|
12
15
|
createUser(body: components['schemas']['user__create_invited_user__Request'], headers?: operations['create-invited-user']['parameters']['header']): Promise<{
|
|
13
16
|
user_id: string;
|
|
14
17
|
verify_link: string | null;
|
|
15
18
|
}>;
|
|
19
|
+
/** Delete a user by ID. */
|
|
16
20
|
deleteUser(userId: string, headers?: operations['delete-user']['parameters']['header']): Promise<void>;
|
|
21
|
+
/** Update user information. */
|
|
17
22
|
updateUser(userId: string, body: components['schemas']['user__update_user_info__Request'], headers?: operations['update-user-info']['parameters']['header']): Promise<void>;
|
|
18
23
|
getUserModel(userId: string, headers?: operations['get-user-model']['parameters']['header']): Promise<{
|
|
19
24
|
user_models: components["schemas"]["UserModel"][];
|