@ax-llm/ax 9.0.3 → 9.0.7
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/CHANGELOG.md +184 -0
- package/README.md +21 -8
- package/build/module/src/ai/anthropic/api.d.ts +10 -9
- package/build/module/src/ai/anthropic/api.js +12 -8
- package/build/module/src/ai/anthropic/api.js.map +1 -1
- package/build/module/src/ai/anthropic/info.js +12 -6
- package/build/module/src/ai/anthropic/info.js.map +1 -1
- package/build/module/src/ai/anthropic/types.d.ts +16 -15
- package/build/module/src/ai/anthropic/types.js +9 -8
- package/build/module/src/ai/anthropic/types.js.map +1 -1
- package/build/module/src/ai/azure-openai/api.d.ts +11 -10
- package/build/module/src/ai/azure-openai/api.js +11 -7
- package/build/module/src/ai/azure-openai/api.js.map +1 -1
- package/build/module/src/ai/cohere/api.d.ts +13 -12
- package/build/module/src/ai/cohere/api.js +17 -13
- package/build/module/src/ai/cohere/api.js.map +1 -1
- package/build/module/src/ai/cohere/info.js +9 -9
- package/build/module/src/ai/cohere/info.js.map +1 -1
- package/build/module/src/ai/cohere/types.d.ts +12 -12
- package/build/module/src/ai/cohere/types.js +14 -14
- package/build/module/src/ai/cohere/types.js.map +1 -1
- package/build/module/src/ai/deepseek/api.d.ts +9 -8
- package/build/module/src/ai/deepseek/api.js +13 -9
- package/build/module/src/ai/deepseek/api.js.map +1 -1
- package/build/module/src/ai/deepseek/info.js +3 -3
- package/build/module/src/ai/deepseek/info.js.map +1 -1
- package/build/module/src/ai/deepseek/types.d.ts +1 -1
- package/build/module/src/ai/deepseek/types.js +5 -5
- package/build/module/src/ai/deepseek/types.js.map +1 -1
- package/build/module/src/ai/google-gemini/api.d.ts +15 -14
- package/build/module/src/ai/google-gemini/api.js +27 -23
- package/build/module/src/ai/google-gemini/api.js.map +1 -1
- package/build/module/src/ai/google-gemini/info.d.ts +1 -1
- package/build/module/src/ai/google-gemini/info.js +5 -5
- package/build/module/src/ai/google-gemini/info.js.map +1 -1
- package/build/module/src/ai/google-gemini/types.d.ts +32 -32
- package/build/module/src/ai/google-gemini/types.js +25 -25
- package/build/module/src/ai/google-gemini/types.js.map +1 -1
- package/build/module/src/ai/groq/api.d.ts +8 -7
- package/build/module/src/ai/groq/api.js +12 -8
- package/build/module/src/ai/groq/api.js.map +1 -1
- package/build/module/src/ai/groq/types.d.ts +1 -1
- package/build/module/src/ai/groq/types.js +7 -7
- package/build/module/src/ai/groq/types.js.map +1 -1
- package/build/module/src/ai/huggingface/api.d.ts +10 -9
- package/build/module/src/ai/huggingface/api.js +14 -10
- package/build/module/src/ai/huggingface/api.js.map +1 -1
- package/build/module/src/ai/huggingface/types.d.ts +6 -6
- package/build/module/src/ai/huggingface/types.js +4 -4
- package/build/module/src/ai/huggingface/types.js.map +1 -1
- package/build/module/src/ai/index.d.ts +1 -13
- package/build/module/src/ai/index.js +1 -39
- package/build/module/src/ai/index.js.map +1 -1
- package/build/module/src/ai/mistral/api.d.ts +9 -8
- package/build/module/src/ai/mistral/api.js +14 -10
- package/build/module/src/ai/mistral/api.js.map +1 -1
- package/build/module/src/ai/mistral/info.js +6 -6
- package/build/module/src/ai/mistral/info.js.map +1 -1
- package/build/module/src/ai/mistral/types.d.ts +2 -2
- package/build/module/src/ai/mistral/types.js +12 -12
- package/build/module/src/ai/mistral/types.js.map +1 -1
- package/build/module/src/ai/ollama/api.d.ts +10 -9
- package/build/module/src/ai/ollama/api.js +10 -10
- package/build/module/src/ai/ollama/api.js.map +1 -1
- package/build/module/src/ai/openai/api.d.ts +15 -14
- package/build/module/src/ai/openai/api.js +23 -19
- package/build/module/src/ai/openai/api.js.map +1 -1
- package/build/module/src/ai/openai/info.js +8 -8
- package/build/module/src/ai/openai/info.js.map +1 -1
- package/build/module/src/ai/openai/types.d.ts +17 -17
- package/build/module/src/ai/openai/types.js +17 -17
- package/build/module/src/ai/openai/types.js.map +1 -1
- package/build/module/src/ai/together/api.d.ts +8 -7
- package/build/module/src/ai/together/api.js +9 -5
- package/build/module/src/ai/together/api.js.map +1 -1
- package/build/module/src/ai/types.d.ts +2 -2
- package/build/module/src/ai/wrap.d.ts +47 -0
- package/build/module/src/ai/wrap.js +95 -0
- package/build/module/src/ai/wrap.js.map +1 -0
- package/build/module/src/db/base.d.ts +7 -7
- package/build/module/src/db/base.js +1 -1
- package/build/module/src/db/cloudflare.d.ts +9 -9
- package/build/module/src/db/cloudflare.js +2 -2
- package/build/module/src/db/cloudflare.js.map +1 -1
- package/build/module/src/db/index.d.ts +1 -6
- package/build/module/src/db/index.js +1 -17
- package/build/module/src/db/index.js.map +1 -1
- package/build/module/src/db/memory.d.ts +9 -9
- package/build/module/src/db/memory.js +2 -2
- package/build/module/src/db/memory.js.map +1 -1
- package/build/module/src/db/pinecone.d.ts +9 -9
- package/build/module/src/db/pinecone.js +2 -2
- package/build/module/src/db/pinecone.js.map +1 -1
- package/build/module/src/db/weaviate.d.ts +9 -9
- package/build/module/src/db/weaviate.js +2 -2
- package/build/module/src/db/weaviate.js.map +1 -1
- package/build/module/src/db/wrap.d.ts +13 -0
- package/build/module/src/db/wrap.js +35 -0
- package/build/module/src/db/wrap.js.map +1 -0
- package/build/module/src/dsp/generate.js +8 -2
- package/build/module/src/dsp/generate.js.map +1 -1
- package/build/module/src/dsp/program.d.ts +1 -0
- package/build/module/src/dsp/program.js.map +1 -1
- package/build/module/src/dsp/router.js +2 -2
- package/build/module/src/examples/agent.js +3 -2
- package/build/module/src/examples/agent.js.map +1 -1
- package/build/module/src/examples/balancer.d.ts +1 -0
- package/build/module/src/examples/balancer.js +26 -0
- package/build/module/src/examples/balancer.js.map +1 -0
- package/build/module/src/examples/chain-of-thought.js +3 -2
- package/build/module/src/examples/chain-of-thought.js.map +1 -1
- package/build/module/src/examples/customer-support.js +3 -2
- package/build/module/src/examples/customer-support.js.map +1 -1
- package/build/module/src/examples/fibonacci.js +3 -2
- package/build/module/src/examples/fibonacci.js.map +1 -1
- package/build/module/src/examples/food-search.js +3 -2
- package/build/module/src/examples/food-search.js.map +1 -1
- package/build/module/src/examples/marketing.js +3 -2
- package/build/module/src/examples/marketing.js.map +1 -1
- package/build/module/src/examples/multi-modal.js +4 -3
- package/build/module/src/examples/multi-modal.js.map +1 -1
- package/build/module/src/examples/qna-tune.js +3 -2
- package/build/module/src/examples/qna-tune.js.map +1 -1
- package/build/module/src/examples/qna-use-tuned.js +3 -2
- package/build/module/src/examples/qna-use-tuned.js.map +1 -1
- package/build/module/src/examples/rag-docs.js +4 -3
- package/build/module/src/examples/rag-docs.js.map +1 -1
- package/build/module/src/examples/rag.js +3 -2
- package/build/module/src/examples/rag.js.map +1 -1
- package/build/module/src/examples/react.js +3 -2
- package/build/module/src/examples/react.js.map +1 -1
- package/build/module/src/examples/routing.js +3 -2
- package/build/module/src/examples/routing.js.map +1 -1
- package/build/module/src/examples/smart-home.js +3 -2
- package/build/module/src/examples/smart-home.js.map +1 -1
- package/build/module/src/examples/streaming1.js +8 -6
- package/build/module/src/examples/streaming1.js.map +1 -1
- package/build/module/src/examples/streaming2.js +7 -5
- package/build/module/src/examples/streaming2.js.map +1 -1
- package/build/module/src/examples/summarize.js +6 -4
- package/build/module/src/examples/summarize.js.map +1 -1
- package/build/module/src/examples/vectordb.js +4 -4
- package/build/module/src/examples/vectordb.js.map +1 -1
- package/build/module/src/prompts/prompts.test.js +7 -3
- package/build/module/src/prompts/prompts.test.js.map +1 -1
- package/package.json +7 -5
- package/build/module/src/text/functions.d.ts +0 -8
- package/build/module/src/text/functions.js +0 -55
- package/build/module/src/text/functions.js.map +0 -1
- package/build/module/src/text/index.d.ts +0 -3
- package/build/module/src/text/index.js +0 -4
- package/build/module/src/text/index.js.map +0 -1
- package/build/module/src/text/jsonschema.d.ts +0 -1
- package/build/module/src/text/jsonschema.js +0 -96
- package/build/module/src/text/jsonschema.js.map +0 -1
- package/build/module/src/text/memory.d.ts +0 -21
- package/build/module/src/text/memory.js +0 -73
- package/build/module/src/text/memory.js.map +0 -1
- package/build/module/src/text/types.d.ts +0 -57
- package/build/module/src/text/types.js +0 -2
- package/build/module/src/text/types.js.map +0 -1
- package/build/module/src/types/index.d.ts +0 -51
- package/build/module/src/types/index.js +0 -2
- package/build/module/src/types/index.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const
|
|
3
|
-
export const
|
|
4
|
-
export const
|
|
5
|
-
export const
|
|
6
|
-
export class
|
|
1
|
+
import { AxAIOpenAI, axAIOpenAIBestConfig, axAIOpenAICreativeConfig, axAIOpenAIDefaultConfig, axAIOpenAIFastConfig } from '../openai/api.js';
|
|
2
|
+
export const axAIAzureOpenAIDefaultConfig = axAIOpenAIDefaultConfig;
|
|
3
|
+
export const axAIAzureOpenAICreativeConfig = axAIOpenAICreativeConfig;
|
|
4
|
+
export const axAIAzureOpenAIFastConfig = axAIOpenAIFastConfig;
|
|
5
|
+
export const axAIAzureOpenAIBestConfig = axAIOpenAIBestConfig;
|
|
6
|
+
export class AxAIAzureOpenAI extends AxAIOpenAI {
|
|
7
7
|
constructor({ apiKey, resourceName, deploymentName, version = 'api-version=2024-02-15-preview', config, options }) {
|
|
8
8
|
if (!apiKey || apiKey === '') {
|
|
9
9
|
throw new Error('Azure OpenAPI API key not set');
|
|
@@ -14,7 +14,11 @@ export class AxAzureOpenAI extends AxOpenAI {
|
|
|
14
14
|
if (!deploymentName || deploymentName === '') {
|
|
15
15
|
throw new Error('Azure OpenAPI deployment id not set');
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
const _config = {
|
|
18
|
+
...axAIAzureOpenAIDefaultConfig(),
|
|
19
|
+
...config
|
|
20
|
+
};
|
|
21
|
+
super({ apiKey, config: _config, options });
|
|
18
22
|
const host = resourceName.includes('://')
|
|
19
23
|
? resourceName
|
|
20
24
|
: `https://${resourceName}.openai.azure.com/`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/ai/azure-openai/api.ts"],"names":[],"mapp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EhD,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;QAE9B,KAAK,CAAC,SAAS,CACb,IAAI,GAAG,CACL,uBAAuB,cAAc,gBAAgB,OAAO,EAAE,EAC9D,IAAI,CACL,CAAC,IAAI,CACP,CAAC;QAEF,KAAK,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { API } from '../../util/apicall.js';
|
|
2
2
|
import { AxBaseAI } from '../base.js';
|
|
3
3
|
import type { AxAIPromptConfig, AxAIServiceOptions, AxChatRequest, AxChatResponse, AxEmbedRequest, AxEmbedResponse, AxModelConfig } from '../types.js';
|
|
4
|
-
import { type
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export interface
|
|
4
|
+
import { type AxAICohereChatRequest, type AxAICohereChatResponse, type AxAICohereChatResponseDelta, type AxAICohereConfig, type AxAICohereEmbedRequest, type AxAICohereEmbedResponse } from './types.js';
|
|
5
|
+
export declare const axAICohereDefaultConfig: () => AxAICohereConfig;
|
|
6
|
+
export declare const axAICohereCreativeConfig: () => AxAICohereConfig;
|
|
7
|
+
export interface AxAICohereArgs {
|
|
8
|
+
name: 'cohere';
|
|
8
9
|
apiKey: string;
|
|
9
|
-
config: Readonly<
|
|
10
|
+
config: Readonly<AxAICohereConfig>;
|
|
10
11
|
options?: Readonly<AxAIServiceOptions>;
|
|
11
12
|
}
|
|
12
|
-
export declare class
|
|
13
|
+
export declare class AxAICohere extends AxBaseAI<AxAICohereChatRequest, AxAICohereEmbedRequest, AxAICohereChatResponse, AxAICohereChatResponseDelta, AxAICohereEmbedResponse> {
|
|
13
14
|
private config;
|
|
14
|
-
constructor({ apiKey, config, options }: Readonly<
|
|
15
|
+
constructor({ apiKey, config, options }: Readonly<Omit<AxAICohereArgs, 'name'>>);
|
|
15
16
|
getModelConfig(): AxModelConfig;
|
|
16
|
-
generateChatReq: (req: Readonly<AxChatRequest>, _config: Readonly<AxAIPromptConfig>) => [API,
|
|
17
|
-
generateEmbedReq: (req: Readonly<AxEmbedRequest>) => [API,
|
|
18
|
-
generateChatResp: (resp: Readonly<
|
|
19
|
-
generateChatStreamResp: (resp: Readonly<
|
|
20
|
-
generateEmbedResp: (resp: Readonly<
|
|
17
|
+
generateChatReq: (req: Readonly<AxChatRequest>, _config: Readonly<AxAIPromptConfig>) => [API, AxAICohereChatRequest];
|
|
18
|
+
generateEmbedReq: (req: Readonly<AxEmbedRequest>) => [API, AxAICohereEmbedRequest];
|
|
19
|
+
generateChatResp: (resp: Readonly<AxAICohereChatResponse>) => AxChatResponse;
|
|
20
|
+
generateChatStreamResp: (resp: Readonly<AxAICohereChatResponseDelta>, state: object) => AxChatResponse;
|
|
21
|
+
generateEmbedResp: (resp: Readonly<AxAICohereEmbedResponse>) => AxEmbedResponse;
|
|
21
22
|
}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
1
|
import { AxBaseAI, axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig } from '../base.js';
|
|
2
2
|
import { axModelInfoCohere } from './info.js';
|
|
3
|
-
import {
|
|
4
|
-
export const
|
|
5
|
-
model:
|
|
6
|
-
embedModel:
|
|
3
|
+
import { AxAICohereEmbedModel, AxAICohereModel } from './types.js';
|
|
4
|
+
export const axAICohereDefaultConfig = () => structuredClone({
|
|
5
|
+
model: AxAICohereModel.Command,
|
|
6
|
+
embedModel: AxAICohereEmbedModel.EmbedEnglishV30,
|
|
7
7
|
...axBaseAIDefaultConfig()
|
|
8
8
|
});
|
|
9
|
-
export const
|
|
10
|
-
model:
|
|
11
|
-
embedModel:
|
|
9
|
+
export const axAICohereCreativeConfig = () => structuredClone({
|
|
10
|
+
model: AxAICohereModel.CommandR,
|
|
11
|
+
embedModel: AxAICohereEmbedModel.EmbedEnglishV30,
|
|
12
12
|
...axBaseAIDefaultCreativeConfig()
|
|
13
13
|
});
|
|
14
|
-
export class
|
|
14
|
+
export class AxAICohere extends AxBaseAI {
|
|
15
15
|
config;
|
|
16
|
-
constructor({ apiKey, config
|
|
16
|
+
constructor({ apiKey, config, options }) {
|
|
17
17
|
if (!apiKey || apiKey === '') {
|
|
18
18
|
throw new Error('Cohere API key not set');
|
|
19
19
|
}
|
|
20
|
+
const _config = {
|
|
21
|
+
...axAICohereDefaultConfig(),
|
|
22
|
+
...config
|
|
23
|
+
};
|
|
20
24
|
super({
|
|
21
25
|
name: 'Cohere',
|
|
22
26
|
apiURL: 'https://api.cohere.ai',
|
|
23
27
|
headers: { Authorization: `Bearer ${apiKey}` },
|
|
24
28
|
modelInfo: axModelInfoCohere,
|
|
25
|
-
models: { model:
|
|
29
|
+
models: { model: _config.model },
|
|
26
30
|
supportFor: { functions: false, streaming: true },
|
|
27
31
|
options
|
|
28
32
|
});
|
|
29
|
-
this.config =
|
|
33
|
+
this.config = _config;
|
|
30
34
|
}
|
|
31
35
|
getModelConfig() {
|
|
32
36
|
const { config } = this;
|
|
@@ -44,7 +48,7 @@ export class AxCohere extends AxBaseAI {
|
|
|
44
48
|
generateChatReq = (req,
|
|
45
49
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
46
50
|
_config) => {
|
|
47
|
-
const model = req.
|
|
51
|
+
const model = req.model ?? this.config.model;
|
|
48
52
|
const lastChatMsg = req.chatPrompt.at(-1);
|
|
49
53
|
const restOfChat = req.chatPrompt.slice(0, -1);
|
|
50
54
|
if (Array.isArray(lastChatMsg?.content)) {
|
|
@@ -126,7 +130,7 @@ export class AxCohere extends AxBaseAI {
|
|
|
126
130
|
return [apiConfig, reqValue];
|
|
127
131
|
};
|
|
128
132
|
generateEmbedReq = (req) => {
|
|
129
|
-
const model = req.
|
|
133
|
+
const model = req.embedModel ?? this.config.embedModel;
|
|
130
134
|
if (!model) {
|
|
131
135
|
throw new Error('Embed model not set');
|
|
132
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/ai/cohere/api.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAKL,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/ai/cohere/api.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAKL,oBAAoB,EAGpB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAqB,EAAE,CAC5D,eAAe,CAAC;IACd,KAAK,EAAE,eAAe,CAAC,OAAO;IAC9B,UAAU,EAAE,oBAAoB,CAAC,eAAe;IAChD,GAAG,qBAAqB,EAAE;CAC3B,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAqB,EAAE,CAC7D,eAAe,CAAC;IACd,KAAK,EAAE,eAAe,CAAC,QAAQ;IAC/B,UAAU,EAAE,oBAAoB,CAAC,eAAe;IAChD,GAAG,6BAA6B,EAAE;CACnC,CAAC,CAAC;AASL,MAAM,OAAO,UAAW,SAAQ,QAM/B;IACS,MAAM,CAAmB;IAEjC,YAAY,EACV,MAAM,EACN,MAAM,EACN,OAAO,EACgC;QACvC,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC5C,CAAC;QACD,MAAM,OAAO,GAAG;YACd,GAAG,uBAAuB,EAAE;YAC5B,GAAG,MAAM;SACV,CAAC;QACF,KAAK,CAAC;YACJ,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,uBAAuB;YAC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AO,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;QAC/B,CAAC;QAED,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC;QACnC,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC,CAAC;IAEO,iBAAiB,GAAG,CAC3B,IAAuC,EACtB,EAAE;QACnB,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,EAAE;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;IACJ,CAAC,CAAC;CACH"}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxAICohereEmbedModel, AxAICohereModel } from './types.js';
|
|
2
2
|
export const axModelInfoCohere = [
|
|
3
3
|
{
|
|
4
|
-
name:
|
|
4
|
+
name: AxAICohereModel.CommandRPlus,
|
|
5
5
|
currency: 'usd',
|
|
6
6
|
promptTokenCostPer1M: 3.0,
|
|
7
7
|
completionTokenCostPer1M: 15
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
name:
|
|
10
|
+
name: AxAICohereModel.CommandR,
|
|
11
11
|
currency: 'usd',
|
|
12
12
|
promptTokenCostPer1M: 0.5,
|
|
13
13
|
completionTokenCostPer1M: 1.5
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
name:
|
|
16
|
+
name: AxAICohereModel.Command,
|
|
17
17
|
currency: 'usd',
|
|
18
18
|
promptTokenCostPer1M: 0.5,
|
|
19
19
|
completionTokenCostPer1M: 1.5
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
name:
|
|
22
|
+
name: AxAICohereModel.CommandLight,
|
|
23
23
|
currency: 'usd',
|
|
24
24
|
promptTokenCostPer1M: 0.3,
|
|
25
25
|
completionTokenCostPer1M: 0.6
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
name:
|
|
28
|
+
name: AxAICohereEmbedModel.EmbedEnglishLightV30,
|
|
29
29
|
currency: 'usd',
|
|
30
30
|
promptTokenCostPer1M: 0.1,
|
|
31
31
|
completionTokenCostPer1M: 0.1
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
name:
|
|
34
|
+
name: AxAICohereEmbedModel.EmbedEnglishV30,
|
|
35
35
|
currency: 'usd',
|
|
36
36
|
promptTokenCostPer1M: 0.1,
|
|
37
37
|
completionTokenCostPer1M: 0.1
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
name:
|
|
40
|
+
name: AxAICohereEmbedModel.EmbedMultiLingualV30,
|
|
41
41
|
currency: 'usd',
|
|
42
42
|
promptTokenCostPer1M: 0.1,
|
|
43
43
|
completionTokenCostPer1M: 0.1
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
name:
|
|
46
|
+
name: AxAICohereEmbedModel.EmbedMultiLingualLightV30,
|
|
47
47
|
currency: 'usd',
|
|
48
48
|
promptTokenCostPer1M: 0.1,
|
|
49
49
|
completionTokenCostPer1M: 0.1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../../src/ai/cohere/info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../../src/ai/cohere/info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC9C;QACE,IAAI,EAAE,eAAe,CAAC,YAAY;QAClC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,EAAE;KAC7B;IACD;QACE,IAAI,EAAE,eAAe,CAAC,QAAQ;QAC9B,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,GAAG;KAC9B;IACD;QACE,IAAI,EAAE,eAAe,CAAC,OAAO;QAC7B,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,GAAG;KAC9B;IACD;QACE,IAAI,EAAE,eAAe,CAAC,YAAY;QAClC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,GAAG;KAC9B;IACD;QACE,IAAI,EAAE,oBAAoB,CAAC,oBAAoB;QAC/C,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,GAAG;KAC9B;IACD;QACE,IAAI,EAAE,oBAAoB,CAAC,eAAe;QAC1C,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,GAAG;KAC9B;IACD;QACE,IAAI,EAAE,oBAAoB,CAAC,oBAAoB;QAC/C,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,GAAG;KAC9B;IACD;QACE,IAAI,EAAE,oBAAoB,CAAC,yBAAyB;QACpD,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,GAAG;QACzB,wBAAwB,EAAE,GAAG;KAC9B;CACF,CAAC"}
|
|
@@ -3,7 +3,7 @@ import type { AxModelConfig } from '../types.js';
|
|
|
3
3
|
* Cohere: Models for text generation
|
|
4
4
|
* @export
|
|
5
5
|
*/
|
|
6
|
-
export declare enum
|
|
6
|
+
export declare enum AxAICohereModel {
|
|
7
7
|
CommandRPlus = "command-r-plus",
|
|
8
8
|
CommandR = "command-r",
|
|
9
9
|
Command = "command",
|
|
@@ -13,7 +13,7 @@ export declare enum AxCohereModel {
|
|
|
13
13
|
* Cohere: Models for use in embeddings
|
|
14
14
|
* @export
|
|
15
15
|
*/
|
|
16
|
-
export declare enum
|
|
16
|
+
export declare enum AxAICohereEmbedModel {
|
|
17
17
|
EmbedEnglishV30 = "embed-english-v3.0",
|
|
18
18
|
EmbedEnglishLightV30 = "embed-english-light-v3.0",
|
|
19
19
|
EmbedMultiLingualV30 = "embed-multilingual-v3.0",
|
|
@@ -23,18 +23,18 @@ export declare enum AxCohereEmbedModel {
|
|
|
23
23
|
* Cohere: Model options for text generation
|
|
24
24
|
* @export
|
|
25
25
|
*/
|
|
26
|
-
export type
|
|
27
|
-
model:
|
|
28
|
-
embedModel:
|
|
26
|
+
export type AxAICohereConfig = AxModelConfig & {
|
|
27
|
+
model: AxAICohereModel;
|
|
28
|
+
embedModel: AxAICohereEmbedModel;
|
|
29
29
|
};
|
|
30
|
-
export type
|
|
30
|
+
export type AxAICohereChatRequest = {
|
|
31
31
|
message: string;
|
|
32
32
|
preamble?: string;
|
|
33
33
|
chat_history: {
|
|
34
34
|
role: 'CHATBOT' | 'SYSTEM' | 'USER';
|
|
35
35
|
message: string;
|
|
36
36
|
}[];
|
|
37
|
-
model:
|
|
37
|
+
model: AxAICohereModel | string;
|
|
38
38
|
max_tokens?: number;
|
|
39
39
|
temperature?: number;
|
|
40
40
|
k?: number;
|
|
@@ -60,7 +60,7 @@ export type AxCohereChatRequest = {
|
|
|
60
60
|
outputs: object[];
|
|
61
61
|
}[];
|
|
62
62
|
};
|
|
63
|
-
export type
|
|
63
|
+
export type AxAICohereChatResponse = {
|
|
64
64
|
generation_id: string;
|
|
65
65
|
text: string;
|
|
66
66
|
finish_reason: 'COMPLETE' | 'ERROR' | 'ERROR_TOXIC' | 'ERROR_LIMIT' | 'USER_CANCEL' | 'MAX_TOKENS';
|
|
@@ -69,15 +69,15 @@ export type AxCohereChatResponse = {
|
|
|
69
69
|
parameters: object;
|
|
70
70
|
}[];
|
|
71
71
|
};
|
|
72
|
-
export type
|
|
72
|
+
export type AxAICohereChatResponseDelta = AxAICohereChatResponse & {
|
|
73
73
|
event_type: 'stream-start' | 'text-generation' | 'tool-calls-generation' | 'stream-end';
|
|
74
74
|
};
|
|
75
|
-
export type
|
|
75
|
+
export type AxAICohereEmbedRequest = {
|
|
76
76
|
texts: readonly string[];
|
|
77
|
-
model:
|
|
77
|
+
model: AxAICohereModel | string;
|
|
78
78
|
truncate: string;
|
|
79
79
|
};
|
|
80
|
-
export type
|
|
80
|
+
export type AxAICohereEmbedResponse = {
|
|
81
81
|
id: string;
|
|
82
82
|
texts: string[];
|
|
83
83
|
model: string;
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
* Cohere: Models for text generation
|
|
3
3
|
* @export
|
|
4
4
|
*/
|
|
5
|
-
export var
|
|
6
|
-
(function (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(
|
|
5
|
+
export var AxAICohereModel;
|
|
6
|
+
(function (AxAICohereModel) {
|
|
7
|
+
AxAICohereModel["CommandRPlus"] = "command-r-plus";
|
|
8
|
+
AxAICohereModel["CommandR"] = "command-r";
|
|
9
|
+
AxAICohereModel["Command"] = "command";
|
|
10
|
+
AxAICohereModel["CommandLight"] = "command-light";
|
|
11
|
+
})(AxAICohereModel || (AxAICohereModel = {}));
|
|
12
12
|
/**
|
|
13
13
|
* Cohere: Models for use in embeddings
|
|
14
14
|
* @export
|
|
15
15
|
*/
|
|
16
|
-
export var
|
|
17
|
-
(function (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})(
|
|
16
|
+
export var AxAICohereEmbedModel;
|
|
17
|
+
(function (AxAICohereEmbedModel) {
|
|
18
|
+
AxAICohereEmbedModel["EmbedEnglishV30"] = "embed-english-v3.0";
|
|
19
|
+
AxAICohereEmbedModel["EmbedEnglishLightV30"] = "embed-english-light-v3.0";
|
|
20
|
+
AxAICohereEmbedModel["EmbedMultiLingualV30"] = "embed-multilingual-v3.0";
|
|
21
|
+
AxAICohereEmbedModel["EmbedMultiLingualLightV30"] = "embed-multilingual-light-v3.0";
|
|
22
|
+
})(AxAICohereEmbedModel || (AxAICohereEmbedModel = {}));
|
|
23
23
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/ai/cohere/types.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/ai/cohere/types.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,kDAA+B,CAAA;IAC/B,yCAAsB,CAAA;IACtB,sCAAmB,CAAA;IACnB,iDAA8B,CAAA;AAChC,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,8DAAsC,CAAA;IACtC,yEAAiD,CAAA;IACjD,wEAAgD,CAAA;IAChD,mFAA2D,CAAA;AAC7D,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import { AxAIOpenAI } from '../openai/api.js';
|
|
2
|
+
import type { AxAIOpenAIConfig } from '../openai/types.js';
|
|
3
3
|
import type { AxAIServiceOptions } from '../types.js';
|
|
4
|
-
type DeepSeekConfig =
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export interface
|
|
4
|
+
type DeepSeekConfig = AxAIOpenAIConfig;
|
|
5
|
+
export declare const axAIDeepSeekDefaultConfig: () => DeepSeekConfig;
|
|
6
|
+
export declare const axAIDeepSeekCodeConfig: () => DeepSeekConfig;
|
|
7
|
+
export interface AxAIDeepSeekArgs {
|
|
8
|
+
name: 'deepseek';
|
|
8
9
|
apiKey: string;
|
|
9
10
|
config: Readonly<DeepSeekConfig>;
|
|
10
11
|
options?: Readonly<AxAIServiceOptions>;
|
|
11
12
|
}
|
|
12
|
-
export declare class
|
|
13
|
-
constructor({ apiKey, config, options }: Readonly<
|
|
13
|
+
export declare class AxAIDeepSeek extends AxAIOpenAI {
|
|
14
|
+
constructor({ apiKey, config, options }: Readonly<Omit<AxAIDeepSeekArgs, 'name'>>);
|
|
14
15
|
}
|
|
15
16
|
export {};
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { axBaseAIDefaultConfig, axBaseAIDefaultCreativeConfig } from '../base.js';
|
|
2
|
-
import {
|
|
2
|
+
import { AxAIOpenAI } from '../openai/api.js';
|
|
3
3
|
import { axModelInfoDeepSeek } from './info.js';
|
|
4
|
-
import {
|
|
5
|
-
export const
|
|
6
|
-
model:
|
|
4
|
+
import { AxAIDeepSeekModel } from './types.js';
|
|
5
|
+
export const axAIDeepSeekDefaultConfig = () => structuredClone({
|
|
6
|
+
model: AxAIDeepSeekModel.DeepSeekChat,
|
|
7
7
|
...axBaseAIDefaultConfig()
|
|
8
8
|
});
|
|
9
|
-
export const
|
|
10
|
-
model:
|
|
9
|
+
export const axAIDeepSeekCodeConfig = () => structuredClone({
|
|
10
|
+
model: AxAIDeepSeekModel.DeepSeekCoder,
|
|
11
11
|
...axBaseAIDefaultCreativeConfig()
|
|
12
12
|
});
|
|
13
|
-
export class
|
|
14
|
-
constructor({ apiKey, config
|
|
13
|
+
export class AxAIDeepSeek extends AxAIOpenAI {
|
|
14
|
+
constructor({ apiKey, config, options }) {
|
|
15
15
|
if (!apiKey || apiKey === '') {
|
|
16
16
|
throw new Error('DeepSeek API key not set');
|
|
17
17
|
}
|
|
18
|
+
const _config = {
|
|
19
|
+
...axAIDeepSeekDefaultConfig(),
|
|
20
|
+
...config
|
|
21
|
+
};
|
|
18
22
|
super({
|
|
19
23
|
apiKey,
|
|
20
|
-
config,
|
|
24
|
+
config: _config,
|
|
21
25
|
options,
|
|
22
26
|
apiURL: 'https://api.deepseek.com',
|
|
23
27
|
modelInfo: axModelInfoDeepSeek
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/ai/deepseek/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../src/ai/deepseek/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAmB,EAAE,CAC5D,eAAe,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC,YAAY;IACrC,GAAG,qBAAqB,EAAE;CAC3B,CAAC,CAAC;AAEL,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAmB,EAAE,CACzD,eAAe,CAAC;IACd,KAAK,EAAE,iBAAiB,CAAC,aAAa;IACtC,GAAG,6BAA6B,EAAE;CACnC,CAAC,CAAC;AASL,MAAM,OAAO,YAAa,SAAQ,UAAU;IAC1C,YAAY,EACV,MAAM,EACN,MAAM,EACN,OAAO,EACkC;QACzC,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QACD,MAAM,OAAO,GAAG;YACd,GAAG,yBAAyB,EAAE;YAC9B,GAAG,MAAM;SACV,CAAC;QACF,KAAK,CAAC;YACJ,MAAM;YACN,MAAM,EAAE,OAAO;YACf,OAAO;YACP,MAAM,EAAE,0BAA0B;YAClC,SAAS,EAAE,mBAAmB;SAC/B,CAAC,CAAC;QAEH,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxAIDeepSeekModel } from './types.js';
|
|
2
2
|
export const axModelInfoDeepSeek = [
|
|
3
3
|
{
|
|
4
|
-
name:
|
|
4
|
+
name: AxAIDeepSeekModel.DeepSeekChat,
|
|
5
5
|
currency: 'USD',
|
|
6
6
|
promptTokenCostPer1M: 0.14,
|
|
7
7
|
completionTokenCostPer1M: 0.28
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
name:
|
|
10
|
+
name: AxAIDeepSeekModel.DeepSeekCoder,
|
|
11
11
|
currency: 'USD',
|
|
12
12
|
promptTokenCostPer1M: 0.14,
|
|
13
13
|
completionTokenCostPer1M: 0.28
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../../src/ai/deepseek/info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"info.js","sourceRoot":"","sources":["../../../../../src/ai/deepseek/info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD;QACE,IAAI,EAAE,iBAAiB,CAAC,YAAY;QACpC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,IAAI;QAC1B,wBAAwB,EAAE,IAAI;KAC/B;IACD;QACE,IAAI,EAAE,iBAAiB,CAAC,aAAa;QACrC,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,IAAI;QAC1B,wBAAwB,EAAE,IAAI;KAC/B;CACF,CAAC"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* DeepSeek: Models for text generation
|
|
3
3
|
* @export
|
|
4
4
|
*/
|
|
5
|
-
export var
|
|
6
|
-
(function (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(
|
|
5
|
+
export var AxAIDeepSeekModel;
|
|
6
|
+
(function (AxAIDeepSeekModel) {
|
|
7
|
+
AxAIDeepSeekModel["DeepSeekChat"] = "deepseek-chat";
|
|
8
|
+
AxAIDeepSeekModel["DeepSeekCoder"] = "deepseek-coder";
|
|
9
|
+
})(AxAIDeepSeekModel || (AxAIDeepSeekModel = {}));
|
|
10
10
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/ai/deepseek/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/ai/deepseek/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,mDAA8B,CAAA;IAC9B,qDAAgC,CAAA;AAClC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import type { API } from '../../util/apicall.js';
|
|
2
2
|
import { AxBaseAI } from '../base.js';
|
|
3
3
|
import type { AxAIServiceOptions, AxChatRequest, AxChatResponse, AxEmbedRequest, AxEmbedResponse, AxModelConfig } from '../types.js';
|
|
4
|
-
import { type
|
|
4
|
+
import { type AxAIGoogleGeminiBatchEmbedRequest, type AxAIGoogleGeminiBatchEmbedResponse, type AxAIGoogleGeminiChatRequest, type AxAIGoogleGeminiChatResponse, type AxAIGoogleGeminiChatResponseDelta, type AxAIGoogleGeminiConfig } from './types.js';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* AxAIGoogleGemini: Default Model options for text generation
|
|
7
7
|
* @export
|
|
8
8
|
*/
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export interface
|
|
9
|
+
export declare const axAIGoogleGeminiDefaultConfig: () => AxAIGoogleGeminiConfig;
|
|
10
|
+
export declare const axAIGoogleGeminiDefaultCreativeConfig: () => AxAIGoogleGeminiConfig;
|
|
11
|
+
export interface AxAIGoogleGeminiArgs {
|
|
12
|
+
name: 'google-gemini';
|
|
12
13
|
apiKey: string;
|
|
13
14
|
projectId?: string;
|
|
14
15
|
region?: string;
|
|
15
|
-
config
|
|
16
|
+
config?: Readonly<AxAIGoogleGeminiConfig>;
|
|
16
17
|
options?: Readonly<AxAIServiceOptions>;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
+
* AxAIGoogleGemini: AI Service
|
|
20
21
|
* @export
|
|
21
22
|
*/
|
|
22
|
-
export declare class
|
|
23
|
+
export declare class AxAIGoogleGemini extends AxBaseAI<AxAIGoogleGeminiChatRequest, AxAIGoogleGeminiBatchEmbedRequest, AxAIGoogleGeminiChatResponse, AxAIGoogleGeminiChatResponseDelta, AxAIGoogleGeminiBatchEmbedResponse> {
|
|
23
24
|
private config;
|
|
24
25
|
private apiKey;
|
|
25
|
-
constructor({ apiKey, projectId, region, config, options }: Readonly<
|
|
26
|
+
constructor({ apiKey, projectId, region, config, options }: Readonly<Omit<AxAIGoogleGeminiArgs, 'name'>>);
|
|
26
27
|
getModelConfig(): AxModelConfig;
|
|
27
|
-
generateChatReq: (req: Readonly<AxChatRequest>) => [API,
|
|
28
|
-
generateEmbedReq: (req: Readonly<AxEmbedRequest>) => [API,
|
|
29
|
-
generateChatResp: (resp: Readonly<
|
|
30
|
-
generateChatStreamResp: (resp: Readonly<
|
|
31
|
-
generateEmbedResp: (resp: Readonly<
|
|
28
|
+
generateChatReq: (req: Readonly<AxChatRequest>) => [API, AxAIGoogleGeminiChatRequest];
|
|
29
|
+
generateEmbedReq: (req: Readonly<AxEmbedRequest>) => [API, AxAIGoogleGeminiBatchEmbedRequest];
|
|
30
|
+
generateChatResp: (resp: Readonly<AxAIGoogleGeminiChatResponse>) => AxChatResponse;
|
|
31
|
+
generateChatStreamResp: (resp: Readonly<AxAIGoogleGeminiChatResponseDelta>) => AxChatResponse;
|
|
32
|
+
generateEmbedResp: (resp: Readonly<AxAIGoogleGeminiBatchEmbedResponse>) => AxEmbedResponse;
|
|
32
33
|
}
|