Skip to content

Commit 8171713

Browse files
committed
add support for chatSession vertexai
1 parent c879473 commit 8171713

File tree

9 files changed

+440
-326
lines changed

9 files changed

+440
-326
lines changed

.eslintrc.json

Lines changed: 71 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,74 @@
11
{
2-
"env": {
3-
"commonjs": true,
4-
"es2021": true,
5-
"browser": true,
6-
"node": true
7-
},
8-
"parser": "@typescript-eslint/parser",
9-
"ignorePatterns": [
10-
"dist/"
11-
],
12-
"extends": [
13-
"eslint:recommended",
14-
"standard-with-typescript",
15-
"plugin:@typescript-eslint/recommended",
16-
"plugin:@typescript-eslint/recommended-requiring-type-checking"
17-
],
18-
"plugins": [
19-
"unused-imports"
20-
],
21-
"parserOptions": {
22-
"ecmaVersion": "latest",
23-
"tsconfigRootDir": ".",
24-
"sourceType": "module",
25-
"project": "./tsconfig.json"
26-
},
27-
"overrides": [
2+
"env": {
3+
"commonjs": true,
4+
"es2021": true,
5+
"browser": true,
6+
"node": true
7+
},
8+
"parser": "@typescript-eslint/parser",
9+
"ignorePatterns": ["dist/"],
10+
"extends": [
11+
"eslint:recommended",
12+
"standard-with-typescript",
13+
"plugin:@typescript-eslint/recommended",
14+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
15+
"prettier"
16+
],
17+
"plugins": ["unused-imports"],
18+
"parserOptions": {
19+
"ecmaVersion": "latest",
20+
"tsconfigRootDir": ".",
21+
"sourceType": "module",
22+
"project": "./tsconfig.json"
23+
},
24+
"overrides": [
25+
{
26+
"files": ["src/examples/**/*"],
27+
"rules": {
28+
"no-console": "off"
29+
}
30+
}
31+
],
32+
"rules": {
33+
"space-unary-ops": "off", // Disables the rule that enforces consistent spacing around unary operators like '!' or '++'. Example: allows both '!foo' and '! foo'
34+
"@typescript-eslint/no-this-alias": "warn",
35+
"@typescript-eslint/no-unsafe-return": "off",
36+
"@typescript-eslint/naming-convention": [
37+
"error",
38+
{
39+
"selector": "variable",
40+
"modifiers": ["destructured"],
41+
"format": null
42+
}
43+
],
44+
"@typescript-eslint/no-non-null-assertion": "off",
45+
"@typescript-eslint/unbound-method": "off",
46+
"@typescript-eslint/no-explicit-any": "off",
47+
"@typescript-eslint/restrict-template-expressions": "off",
48+
"@typescript-eslint/no-unsafe-call": "off",
49+
"@typescript-eslint/no-unsafe-assignment": "off",
50+
"@typescript-eslint/no-unsafe-member-access": "off",
51+
"no-underscore-dangle": "off",
52+
"@typescript-eslint/no-unused-vars": "warn",
53+
"unused-imports/no-unused-imports": "error",
54+
"prefer-promise-reject-errors": [
55+
"error",
56+
{
57+
"allowEmptyReject": true
58+
}
59+
],
60+
"no-console": "error",
61+
"max-len": [
62+
"error",
63+
{
64+
"code": 250
65+
}
66+
],
67+
"@typescript-eslint/no-misused-promises": [
68+
"error",
2869
{
29-
"files": [
30-
"src/examples/**/*"
31-
],
32-
"rules": {
33-
"no-console": "off"
34-
}
70+
"checksVoidReturn": false
3571
}
36-
],
37-
"rules": {
38-
"object-curly-newline": [
39-
"error",
40-
{
41-
"ObjectExpression": {
42-
"multiline": true,
43-
"minProperties": 8
44-
},
45-
"ObjectPattern": {
46-
"multiline": true,
47-
"minProperties": 8
48-
},
49-
"ImportDeclaration": {
50-
"multiline": true,
51-
"minProperties": 8
52-
},
53-
"ExportDeclaration": {
54-
"multiline": true,
55-
"minProperties": 8
56-
}
57-
}
58-
],
59-
"no-restricted-imports": [
60-
"error",
61-
{
62-
"patterns": [
63-
".*"
64-
]
65-
}
66-
],
67-
"@typescript-eslint/no-this-alias": "warn",
68-
"@typescript-eslint/no-unsafe-return": "off",
69-
"@typescript-eslint/naming-convention": [
70-
"error",
71-
{
72-
"selector": "variable",
73-
"modifiers": [
74-
"destructured"
75-
],
76-
"format": null
77-
}
78-
],
79-
"space-unary-ops": 2,
80-
"@typescript-eslint/no-non-null-assertion": "off",
81-
"@typescript-eslint/unbound-method": "off",
82-
"@typescript-eslint/no-explicit-any": "off",
83-
"@typescript-eslint/restrict-template-expressions": "off",
84-
"@typescript-eslint/no-unsafe-call": "off",
85-
"@typescript-eslint/no-unsafe-assignment": "off",
86-
"@typescript-eslint/no-unsafe-member-access": "off",
87-
"no-underscore-dangle": "off",
88-
"@typescript-eslint/no-unused-vars": "warn",
89-
"unused-imports/no-unused-imports": "error",
90-
"prefer-promise-reject-errors": [
91-
"error",
92-
{
93-
"allowEmptyReject": true
94-
}
95-
],
96-
"no-console": "error",
97-
"max-len": [
98-
"error",
99-
{
100-
"code": 250
101-
}
102-
],
103-
"@typescript-eslint/no-misused-promises": [
104-
"error",
105-
{
106-
"checksVoidReturn": false
107-
}
108-
]
109-
}
110-
}
72+
]
73+
}
74+
}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ yarn-debug.log*
66
yarn-error.log*
77
lerna-debug.log*
88
.pnpm-debug.log*
9-
9+
.DS_Store
1010
# Diagnostic reports (https://nodejs.org/api/report.html)
1111
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1212

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 120,
6+
"tabWidth": 2
7+
}

package-lock.json

Lines changed: 59 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"license": "Apache-2.0",
2323
"dependencies": {
2424
"@aws-sdk/client-bedrock-runtime": "^3.670.0",
25-
"@langtrase/trace-attributes": "7.5.1",
25+
"@langtrase/trace-attributes": "7.5.2",
2626
"@opentelemetry/api": "^1.7.0",
2727
"@opentelemetry/instrumentation": "^0.49.1",
2828
"@opentelemetry/sdk-trace-base": "^1.22.0",
@@ -38,10 +38,10 @@
3838
"devDependencies": {
3939
"@ai-sdk/anthropic": "^0.0.41",
4040
"@ai-sdk/openai": "^0.0.34",
41-
"@google/generative-ai": "^0.1.3",
4241
"@anthropic-ai/sdk": "^0.24.3",
4342
"@changesets/cli": "^2.27.1",
4443
"@google-cloud/vertexai": "^1.5.0",
44+
"@google/generative-ai": "^0.1.3",
4545
"@mistralai/mistralai": "^1.0.4",
4646
"@opentelemetry/exporter-trace-otlp-http": "^0.53.0",
4747
"@pinecone-database/pinecone": "^2.0.1",
@@ -52,6 +52,7 @@
5252
"cohere-ai": "^7.15.0",
5353
"dotenv": "^16.4.5",
5454
"eslint": "^8.34.0",
55+
"eslint-config-prettier": "^10.1.1",
5556
"eslint-config-standard-with-typescript": "^23.0.0",
5657
"eslint-plugin-import": "^2.26.0",
5758
"eslint-plugin-n": "^15.3.0",
@@ -64,6 +65,7 @@
6465
"ollama": "^0.5.2",
6566
"openai": "^4.47.1",
6667
"pgvector": "^0.1.8",
68+
"prettier": "^3.5.3",
6769
"tsc-alias": "^1.8.8",
6870
"typescript": "^4.9.5",
6971
"weaviate-ts-client": "^2.2.0"

0 commit comments

Comments
 (0)