@squidcloud/openai-voice-client 1.0.493
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/dist/connectors/openai_voice/common/src/openai-voice-types.d.ts +46 -0
- package/dist/connectors/openai_voice/openai-voice-client/src/index.d.ts +2 -0
- package/dist/connectors/openai_voice/openai-voice-client/src/openai-voice-client.d.ts +17 -0
- package/dist/index.js +1 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/package.json +25 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IntegrationId } from '../../../../internal-common/src/public-types/communication.public-types';
|
|
2
|
+
/** Request for the `openAiVoiceSipTarget` executable. */
|
|
3
|
+
export interface OpenAiVoiceSipTargetRequest {
|
|
4
|
+
integrationId: IntegrationId;
|
|
5
|
+
}
|
|
6
|
+
/** Where a call goes for OpenAI to answer it, and where OpenAI announces it. */
|
|
7
|
+
export interface OpenAiVoiceSipTarget {
|
|
8
|
+
/** SIP URI of the OpenAI project; Twilio dials it with the call. */
|
|
9
|
+
sipUri: string;
|
|
10
|
+
/** URL to register in the OpenAI project as its `realtime.call.incoming` webhook. */
|
|
11
|
+
webhookUrl: string;
|
|
12
|
+
}
|
|
13
|
+
/** Response of the `openAiVoiceSipTarget` executable. */
|
|
14
|
+
export type OpenAiVoiceSipTargetResponse = OpenAiVoiceSipTarget;
|
|
15
|
+
/** Request for the `openAiVoiceListModels` executable. */
|
|
16
|
+
export interface ListOpenAiVoiceModelsRequest {
|
|
17
|
+
integrationId: IntegrationId;
|
|
18
|
+
}
|
|
19
|
+
/** Response of the `openAiVoiceListModels` executable. */
|
|
20
|
+
export interface ListOpenAiVoiceModelsResponse {
|
|
21
|
+
/** Realtime model ids the account can use on calls, newest first. */
|
|
22
|
+
models: Array<string>;
|
|
23
|
+
}
|
|
24
|
+
/** Request for the `openAiVoiceListVoices` executable. */
|
|
25
|
+
export interface ListOpenAiVoiceVoicesRequest {
|
|
26
|
+
integrationId: IntegrationId;
|
|
27
|
+
}
|
|
28
|
+
/** Response of the `openAiVoiceListVoices` executable. */
|
|
29
|
+
export interface ListOpenAiVoiceVoicesResponse {
|
|
30
|
+
voices: Array<string>;
|
|
31
|
+
}
|
|
32
|
+
/** One SIP header of an incoming call, as OpenAI reports it. */
|
|
33
|
+
export interface OpenAiSipHeader {
|
|
34
|
+
name: string;
|
|
35
|
+
value: string;
|
|
36
|
+
}
|
|
37
|
+
/** The `realtime.call.incoming` webhook OpenAI posts when a call reaches the project's SIP endpoint. */
|
|
38
|
+
export interface OpenAiVoiceIncomingCallEvent {
|
|
39
|
+
id: string;
|
|
40
|
+
type: string;
|
|
41
|
+
created_at: number;
|
|
42
|
+
data: {
|
|
43
|
+
call_id: string;
|
|
44
|
+
sip_headers?: Array<OpenAiSipHeader>;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ListOpenAiVoiceModelsRequest, ListOpenAiVoiceModelsResponse, ListOpenAiVoiceVoicesRequest, ListOpenAiVoiceVoicesResponse, OpenAiVoiceSipTarget, OpenAiVoiceSipTargetRequest, OpenAiVoiceSipTargetResponse, } from '../../common/src/openai-voice-types';
|
|
2
|
+
export * from './openai-voice-client';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Squid } from '@squidcloud/client';
|
|
2
|
+
import { ListOpenAiVoiceModelsResponse, ListOpenAiVoiceVoicesResponse, OpenAiVoiceSipTargetResponse } from '../../common/src/openai-voice-types';
|
|
3
|
+
/**
|
|
4
|
+
* Client of the OpenAI Voice connector for one integration. Phone agents are set up through the Twilio
|
|
5
|
+
* connector (voice engine `openai`); these calls are the building blocks it and the console use.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SquidOpenAiVoiceClient {
|
|
8
|
+
private readonly squid;
|
|
9
|
+
private readonly integrationId;
|
|
10
|
+
constructor(squid: Squid, integrationId: string);
|
|
11
|
+
/** The SIP URI calls are sent to, and the webhook URL to register in the OpenAI project. */
|
|
12
|
+
sipTarget(): Promise<OpenAiVoiceSipTargetResponse>;
|
|
13
|
+
/** The realtime models the account can put on a call, newest first. */
|
|
14
|
+
listModels(): Promise<ListOpenAiVoiceModelsResponse>;
|
|
15
|
+
/** The voices of the realtime models. */
|
|
16
|
+
listVoices(): Promise<ListOpenAiVoiceVoicesResponse>;
|
|
17
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";const e={d:(t,i)=>{if(Array.isArray(i))for(var r=0;r<i.length;){var o=i[r++],n=i[r++];e.o(t,o)?0===n&&r++:0===n?Object.defineProperty(t,o,{enumerable:!0,value:i[r++]}):Object.defineProperty(t,o,{enumerable:!0,get:n})}else for(var o in i)e.o(i,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:i[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{SquidOpenAiVoiceClient:()=>i});class i{constructor(e,t){this.squid=e,this.integrationId=t}async sipTarget(){return this.squid.executeFunction("openAiVoiceSipTarget",{integrationId:this.integrationId})}async listModels(){return this.squid.executeFunction("openAiVoiceListModels",{integrationId:this.integrationId})}async listVoices(){return this.squid.executeFunction("openAiVoiceListVoices",{integrationId:this.integrationId})}}const r=exports;for(var o in t)r[o]=t[o];t.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** A type alias for an application id. */
|
|
2
|
+
export type AppId = string;
|
|
3
|
+
/** A tuple of environment identifiers like 'dev' or 'prod'. */
|
|
4
|
+
export declare const ENVIRONMENT_IDS: readonly ["dev", "prod"];
|
|
5
|
+
/** A type representing valid environment identifiers derived from ENVIRONMENT_IDS. */
|
|
6
|
+
export type EnvironmentId = (typeof ENVIRONMENT_IDS)[number];
|
|
7
|
+
/** A type alias for a squid developer identifier. */
|
|
8
|
+
export type SquidDeveloperId = string;
|
|
9
|
+
/** A type alias for an integration id. */
|
|
10
|
+
export type IntegrationId = string;
|
|
11
|
+
/** A type alias for a client identifier. */
|
|
12
|
+
export type ClientId = string;
|
|
13
|
+
/** A type alias for a squid document identifier. */
|
|
14
|
+
export type SquidDocId = string;
|
|
15
|
+
/** A type alias for a client request identifier. */
|
|
16
|
+
export type ClientRequestId = string;
|
|
17
|
+
/** ID of AI agent. Also known as AI profile id. */
|
|
18
|
+
export type AiAgentId = string;
|
|
19
|
+
/** App-level ID of AI Knowledge Base */
|
|
20
|
+
export type AiKnowledgeBaseId = string;
|
|
21
|
+
/**
|
|
22
|
+
* The built-in agent id. Cannot be customized.
|
|
23
|
+
* @category AI
|
|
24
|
+
*/
|
|
25
|
+
export declare const BUILT_IN_AGENT_ID = "built_in_agent";
|
|
26
|
+
/**
|
|
27
|
+
* A type alias for an AI context identifier.
|
|
28
|
+
* @category AI
|
|
29
|
+
*/
|
|
30
|
+
export type AiContextId = string;
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@squidcloud/openai-voice-client",
|
|
3
|
+
"version": "1.0.493",
|
|
4
|
+
"description": "Squid OpenAI Voice Client",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/client/src/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prebuild": "del-cli dist",
|
|
9
|
+
"build": "webpack --mode=production",
|
|
10
|
+
"lint": "eslint",
|
|
11
|
+
"publish:public": "npm run build && npm publish --access public"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/**/*"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [],
|
|
17
|
+
"author": "",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@squidcloud/client": "^1.0.493"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=20.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|