@gammatech/aijsx 0.10.1-dev.2024-06-07 → 0.10.2-dev.2024-06-11
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/index.d.mts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +6 -2
- package/dist/index.mjs +11 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6,8 +6,8 @@ export { OpenAI as OpenAIClient } from 'openai';
|
|
|
6
6
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, ChatCompletionAssistantMessageParam, ChatCompletionCreateParams } from 'openai/resources';
|
|
7
7
|
import AnthropicClient from '@anthropic-ai/sdk';
|
|
8
8
|
export { default as AnthropicClient } from '@anthropic-ai/sdk';
|
|
9
|
-
import { PromptFeedback, GenerateContentRequest, VertexAI } from '@google-cloud/vertexai';
|
|
10
|
-
export { VertexAI } from '@google-cloud/vertexai';
|
|
9
|
+
import { PromptFeedback, GenerateContentRequest, VertexAI, HarmCategory, HarmBlockThreshold } from '@google-cloud/vertexai';
|
|
10
|
+
export { HarmBlockThreshold as GoogleHarmBlockThreshold, HarmCategory as GoogleHarmCategory, VertexAI } from '@google-cloud/vertexai';
|
|
11
11
|
|
|
12
12
|
declare class ChatCompletionError extends Error {
|
|
13
13
|
readonly chatCompletionRequest: LogChatCompletionRequest;
|
|
@@ -299,6 +299,10 @@ type GoogleChatCompletionProps = {
|
|
|
299
299
|
stop?: string | string[];
|
|
300
300
|
maxRetries?: number;
|
|
301
301
|
children: AINode;
|
|
302
|
+
safetySettings?: {
|
|
303
|
+
category: HarmCategory;
|
|
304
|
+
threshold: HarmBlockThreshold;
|
|
305
|
+
}[];
|
|
302
306
|
};
|
|
303
307
|
declare function GoogleChatCompletion(props: GoogleChatCompletionProps, ctx: RenderContext): JSX.Element;
|
|
304
308
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export { OpenAI as OpenAIClient } from 'openai';
|
|
|
6
6
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, ChatCompletionAssistantMessageParam, ChatCompletionCreateParams } from 'openai/resources';
|
|
7
7
|
import AnthropicClient from '@anthropic-ai/sdk';
|
|
8
8
|
export { default as AnthropicClient } from '@anthropic-ai/sdk';
|
|
9
|
-
import { PromptFeedback, GenerateContentRequest, VertexAI } from '@google-cloud/vertexai';
|
|
10
|
-
export { VertexAI } from '@google-cloud/vertexai';
|
|
9
|
+
import { PromptFeedback, GenerateContentRequest, VertexAI, HarmCategory, HarmBlockThreshold } from '@google-cloud/vertexai';
|
|
10
|
+
export { HarmBlockThreshold as GoogleHarmBlockThreshold, HarmCategory as GoogleHarmCategory, VertexAI } from '@google-cloud/vertexai';
|
|
11
11
|
|
|
12
12
|
declare class ChatCompletionError extends Error {
|
|
13
13
|
readonly chatCompletionRequest: LogChatCompletionRequest;
|
|
@@ -299,6 +299,10 @@ type GoogleChatCompletionProps = {
|
|
|
299
299
|
stop?: string | string[];
|
|
300
300
|
maxRetries?: number;
|
|
301
301
|
children: AINode;
|
|
302
|
+
safetySettings?: {
|
|
303
|
+
category: HarmCategory;
|
|
304
|
+
threshold: HarmBlockThreshold;
|
|
305
|
+
}[];
|
|
302
306
|
};
|
|
303
307
|
declare function GoogleChatCompletion(props: GoogleChatCompletionProps, ctx: RenderContext): JSX.Element;
|
|
304
308
|
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,8 @@ __export(src_exports, {
|
|
|
44
44
|
Fallback: () => Fallback,
|
|
45
45
|
GoogleChatCompletion: () => GoogleChatCompletion,
|
|
46
46
|
GoogleClientContext: () => GoogleClientContext,
|
|
47
|
+
GoogleHarmBlockThreshold: () => import_vertexai2.HarmBlockThreshold,
|
|
48
|
+
GoogleHarmCategory: () => import_vertexai2.HarmCategory,
|
|
47
49
|
ImagePart: () => ImagePart,
|
|
48
50
|
LogImplementation: () => LogImplementation,
|
|
49
51
|
NoopLogImplementation: () => NoopLogImplementation,
|
|
@@ -2600,7 +2602,7 @@ var errorToChatCompletionError = (error, requestData) => {
|
|
|
2600
2602
|
};
|
|
2601
2603
|
|
|
2602
2604
|
// src/lib/google/Google.tsx
|
|
2603
|
-
var
|
|
2605
|
+
var DEFAULT_SAFETY_SETTINGS = [
|
|
2604
2606
|
{
|
|
2605
2607
|
category: import_vertexai.HarmCategory.HARM_CATEGORY_HATE_SPEECH,
|
|
2606
2608
|
threshold: import_vertexai.HarmBlockThreshold.BLOCK_ONLY_HIGH
|
|
@@ -2754,7 +2756,7 @@ async function* GoogleChatCompletionInner(props, ctx) {
|
|
|
2754
2756
|
});
|
|
2755
2757
|
const model = client.getGenerativeModel({
|
|
2756
2758
|
model: props.model,
|
|
2757
|
-
safetySettings:
|
|
2759
|
+
safetySettings: props.safetySettings || DEFAULT_SAFETY_SETTINGS
|
|
2758
2760
|
});
|
|
2759
2761
|
let response;
|
|
2760
2762
|
try {
|
|
@@ -2882,6 +2884,8 @@ var import_vertexai2 = require("@google-cloud/vertexai");
|
|
|
2882
2884
|
Fallback,
|
|
2883
2885
|
GoogleChatCompletion,
|
|
2884
2886
|
GoogleClientContext,
|
|
2887
|
+
GoogleHarmBlockThreshold,
|
|
2888
|
+
GoogleHarmCategory,
|
|
2885
2889
|
ImagePart,
|
|
2886
2890
|
LogImplementation,
|
|
2887
2891
|
NoopLogImplementation,
|
package/dist/index.mjs
CHANGED
|
@@ -2473,9 +2473,9 @@ import AnthropicClient2 from "@anthropic-ai/sdk";
|
|
|
2473
2473
|
|
|
2474
2474
|
// src/lib/google/Google.tsx
|
|
2475
2475
|
import {
|
|
2476
|
-
|
|
2476
|
+
HarmBlockThreshold,
|
|
2477
2477
|
HarmCategory,
|
|
2478
|
-
|
|
2478
|
+
VertexAI
|
|
2479
2479
|
} from "@google-cloud/vertexai";
|
|
2480
2480
|
|
|
2481
2481
|
// src/lib/google/errors.ts
|
|
@@ -2504,7 +2504,7 @@ var errorToChatCompletionError = (error, requestData) => {
|
|
|
2504
2504
|
};
|
|
2505
2505
|
|
|
2506
2506
|
// src/lib/google/Google.tsx
|
|
2507
|
-
var
|
|
2507
|
+
var DEFAULT_SAFETY_SETTINGS = [
|
|
2508
2508
|
{
|
|
2509
2509
|
category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
|
|
2510
2510
|
threshold: HarmBlockThreshold.BLOCK_ONLY_HIGH
|
|
@@ -2658,7 +2658,7 @@ async function* GoogleChatCompletionInner(props, ctx) {
|
|
|
2658
2658
|
});
|
|
2659
2659
|
const model = client.getGenerativeModel({
|
|
2660
2660
|
model: props.model,
|
|
2661
|
-
safetySettings:
|
|
2661
|
+
safetySettings: props.safetySettings || DEFAULT_SAFETY_SETTINGS
|
|
2662
2662
|
});
|
|
2663
2663
|
let response;
|
|
2664
2664
|
try {
|
|
@@ -2768,7 +2768,11 @@ function cleanChatCompletionRequest3(chatCompletionRequest) {
|
|
|
2768
2768
|
}
|
|
2769
2769
|
|
|
2770
2770
|
// src/lib/google/index.ts
|
|
2771
|
-
import {
|
|
2771
|
+
import {
|
|
2772
|
+
VertexAI as VertexAI2,
|
|
2773
|
+
HarmBlockThreshold as HarmBlockThreshold2,
|
|
2774
|
+
HarmCategory as HarmCategory2
|
|
2775
|
+
} from "@google-cloud/vertexai";
|
|
2772
2776
|
export {
|
|
2773
2777
|
AIFragment,
|
|
2774
2778
|
AISpanProcessor,
|
|
@@ -2785,6 +2789,8 @@ export {
|
|
|
2785
2789
|
Fallback,
|
|
2786
2790
|
GoogleChatCompletion,
|
|
2787
2791
|
GoogleClientContext,
|
|
2792
|
+
HarmBlockThreshold2 as GoogleHarmBlockThreshold,
|
|
2793
|
+
HarmCategory2 as GoogleHarmCategory,
|
|
2788
2794
|
ImagePart,
|
|
2789
2795
|
LogImplementation,
|
|
2790
2796
|
NoopLogImplementation,
|