langchain 0.0.204-rc.0 → 0.0.204-rc.2

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.
Files changed (61) hide show
  1. package/dist/agents/toolkits/aws_sfn.cjs +3 -75
  2. package/dist/agents/toolkits/aws_sfn.d.ts +2 -45
  3. package/dist/agents/toolkits/aws_sfn.js +2 -73
  4. package/dist/agents/toolkits/base.cjs +15 -9
  5. package/dist/agents/toolkits/base.d.ts +1 -9
  6. package/dist/agents/toolkits/base.js +1 -7
  7. package/dist/agents/toolkits/connery/index.cjs +15 -37
  8. package/dist/agents/toolkits/connery/index.d.ts +1 -23
  9. package/dist/agents/toolkits/connery/index.js +1 -35
  10. package/dist/cache/ioredis.cjs +15 -77
  11. package/dist/cache/ioredis.d.ts +1 -40
  12. package/dist/cache/ioredis.js +1 -75
  13. package/dist/memory/chat_memory.cjs +15 -61
  14. package/dist/memory/chat_memory.d.ts +1 -36
  15. package/dist/memory/chat_memory.js +1 -59
  16. package/dist/memory/motorhead_memory.cjs +15 -161
  17. package/dist/memory/motorhead_memory.d.ts +1 -63
  18. package/dist/memory/motorhead_memory.js +1 -159
  19. package/dist/memory/zep.cjs +15 -222
  20. package/dist/memory/zep.d.ts +1 -86
  21. package/dist/memory/zep.js +1 -220
  22. package/dist/schema/runnable/base.cjs +2 -1
  23. package/dist/schema/runnable/base.d.ts +1 -1
  24. package/dist/schema/runnable/base.js +1 -1
  25. package/dist/stores/message/in_memory.cjs +15 -49
  26. package/dist/stores/message/in_memory.d.ts +1 -28
  27. package/dist/stores/message/in_memory.js +1 -47
  28. package/dist/tools/aws_lambda.cjs +15 -83
  29. package/dist/tools/aws_lambda.d.ts +1 -25
  30. package/dist/tools/aws_lambda.js +1 -82
  31. package/dist/tools/dynamic.cjs +15 -87
  32. package/dist/tools/dynamic.d.ts +1 -48
  33. package/dist/tools/dynamic.js +1 -84
  34. package/dist/util/convex.cjs +15 -75
  35. package/dist/util/convex.d.ts +1 -26
  36. package/dist/util/convex.js +1 -74
  37. package/dist/vectorstores/memory.cjs +143 -15
  38. package/dist/vectorstores/memory.d.ts +92 -1
  39. package/dist/vectorstores/memory.js +141 -1
  40. package/package.json +4 -243
  41. package/dist/types/openai-types.cjs +0 -2
  42. package/dist/types/openai-types.d.ts +0 -135
  43. package/dist/types/openai-types.js +0 -1
  44. package/dist/util/chunk.cjs +0 -11
  45. package/dist/util/chunk.d.ts +0 -1
  46. package/dist/util/chunk.js +0 -7
  47. package/dist/util/googlevertexai-gauth.cjs +0 -36
  48. package/dist/util/googlevertexai-gauth.d.ts +0 -8
  49. package/dist/util/googlevertexai-gauth.js +0 -32
  50. package/dist/util/googlevertexai-webauth.cjs +0 -96
  51. package/dist/util/googlevertexai-webauth.d.ts +0 -22
  52. package/dist/util/googlevertexai-webauth.js +0 -92
  53. package/dist/util/iflytek_websocket_stream.cjs +0 -81
  54. package/dist/util/iflytek_websocket_stream.d.ts +0 -27
  55. package/dist/util/iflytek_websocket_stream.js +0 -77
  56. package/dist/util/llama_cpp.cjs +0 -34
  57. package/dist/util/llama_cpp.d.ts +0 -46
  58. package/dist/util/llama_cpp.js +0 -28
  59. package/dist/util/momento.cjs +0 -26
  60. package/dist/util/momento.d.ts +0 -9
  61. package/dist/util/momento.js +0 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langchain",
3
- "version": "0.0.204-rc.0",
3
+ "version": "0.0.204-rc.2",
4
4
  "description": "Typescript bindings for langchain",
5
5
  "type": "module",
6
6
  "engines": {
@@ -882,79 +882,42 @@
882
882
  "author": "LangChain",
883
883
  "license": "MIT",
884
884
  "devDependencies": {
885
- "@aws-sdk/client-lambda": "^3.310.0",
886
885
  "@aws-sdk/client-s3": "^3.310.0",
887
886
  "@aws-sdk/client-sagemaker-runtime": "^3.414.0",
888
887
  "@aws-sdk/client-sfn": "^3.362.0",
889
888
  "@aws-sdk/credential-provider-node": "^3.388.0",
890
889
  "@aws-sdk/types": "^3.357.0",
891
890
  "@azure/storage-blob": "^12.15.0",
892
- "@clickhouse/client": "^0.2.5",
893
- "@cloudflare/ai": "^1.0.12",
894
891
  "@cloudflare/workers-types": "^4.20230922.0",
895
- "@elastic/elasticsearch": "^8.4.0",
896
892
  "@faker-js/faker": "^7.6.0",
897
- "@getmetal/metal-sdk": "^4.0.0",
898
- "@getzep/zep-js": "^0.9.0",
899
893
  "@gomomento/sdk": "^1.51.1",
900
894
  "@gomomento/sdk-core": "^1.51.1",
901
895
  "@google-ai/generativelanguage": "^0.2.1",
902
896
  "@google-cloud/storage": "^6.10.1",
903
- "@gradientai/nodejs-sdk": "^1.2.0",
904
- "@huggingface/inference": "^2.6.4",
905
897
  "@jest/globals": "^29.5.0",
906
- "@mozilla/readability": "^0.4.4",
907
898
  "@notionhq/client": "^2.2.10",
908
- "@opensearch-project/opensearch": "^2.2.0",
909
899
  "@pinecone-database/pinecone": "^1.1.0",
910
- "@planetscale/database": "^1.8.0",
911
- "@qdrant/js-client-rest": "^1.2.0",
912
- "@raycast/api": "^1.55.2",
913
- "@rockset/client": "^0.9.1",
914
- "@smithy/eventstream-codec": "^2.0.5",
915
- "@smithy/protocol-http": "^3.0.6",
916
- "@smithy/signature-v4": "^2.0.10",
917
- "@smithy/util-utf8": "^2.0.0",
918
- "@supabase/postgrest-js": "^1.1.1",
919
900
  "@supabase/supabase-js": "^2.10.0",
920
901
  "@swc/core": "^1.3.90",
921
902
  "@swc/jest": "^0.2.29",
922
- "@tensorflow-models/universal-sentence-encoder": "^1.3.3",
923
- "@tensorflow/tfjs-backend-cpu": "^3",
924
- "@tensorflow/tfjs-converter": "^3.6.0",
925
- "@tensorflow/tfjs-core": "^3.6.0",
926
903
  "@tsconfig/recommended": "^1.0.2",
927
904
  "@types/d3-dsv": "^2",
928
905
  "@types/decamelize": "^1.2.0",
929
906
  "@types/html-to-text": "^9",
930
907
  "@types/js-yaml": "^4",
931
908
  "@types/jsdom": "^21.1.1",
932
- "@types/lodash": "^4",
933
- "@types/mozilla-readability": "^0.2.1",
934
909
  "@types/pdf-parse": "^1.1.1",
935
- "@types/pg": "^8",
936
- "@types/pg-copy-streams": "^1.2.2",
937
910
  "@types/uuid": "^9",
938
911
  "@types/ws": "^8",
939
912
  "@typescript-eslint/eslint-plugin": "^5.58.0",
940
913
  "@typescript-eslint/parser": "^5.58.0",
941
- "@upstash/redis": "^1.20.6",
942
914
  "@vercel/kv": "^0.2.3",
943
- "@vercel/postgres": "^0.5.0",
944
- "@writerai/writer-sdk": "^0.40.2",
945
915
  "@xata.io/client": "^0.28.0",
946
- "@xenova/transformers": "^2.5.4",
947
- "@zilliz/milvus2-sdk-node": ">=2.2.11",
948
916
  "apify-client": "^2.7.1",
949
917
  "assemblyai": "^2.0.2",
950
918
  "axios": "^0.26.0",
951
- "cassandra-driver": "^4.7.2",
952
919
  "cheerio": "^1.0.0-rc.12",
953
920
  "chromadb": "^1.5.3",
954
- "closevector-common": "0.1.0-alpha.1",
955
- "closevector-node": "0.1.0-alpha.10",
956
- "closevector-web": "0.1.0-alpha.15",
957
- "cohere-ai": ">=6.0.0",
958
921
  "convex": "^1.3.1",
959
922
  "d3-dsv": "^2.0.0",
960
923
  "dotenv": "^16.0.3",
@@ -967,151 +930,87 @@
967
930
  "eslint-plugin-jest": "^27.6.0",
968
931
  "eslint-plugin-no-instanceof": "^1.0.1",
969
932
  "eslint-plugin-prettier": "^4.2.1",
970
- "faiss-node": "^0.5.1",
971
933
  "fast-xml-parser": "^4.2.7",
972
- "firebase-admin": "^11.9.0",
973
934
  "google-auth-library": "^8.9.0",
974
935
  "googleapis": "^126.0.1",
975
- "graphql": "^16.6.0",
976
- "hnswlib-node": "^1.4.2",
977
936
  "html-to-text": "^9.0.5",
978
937
  "ignore": "^5.2.0",
979
938
  "ioredis": "^5.3.2",
980
939
  "jest": "^29.5.0",
981
940
  "jest-environment-node": "^29.6.4",
982
941
  "jsdom": "^22.1.0",
983
- "llmonitor": "^0.5.9",
984
- "lodash": "^4.17.21",
985
942
  "mammoth": "^1.5.1",
986
943
  "mongodb": "^5.2.0",
987
- "mysql2": "^3.3.3",
988
- "neo4j-driver": "^5.12.0",
989
944
  "node-llama-cpp": "2.7.3",
990
945
  "notion-to-md": "^3.1.0",
991
946
  "officeparser": "^4.0.4",
992
947
  "pdf-parse": "1.1.1",
993
948
  "peggy": "^3.0.2",
994
- "pg": "^8.11.0",
995
- "pg-copy-streams": "^6.0.5",
996
- "pickleparser": "^0.2.1",
997
949
  "playwright": "^1.32.1",
998
- "portkey-ai": "^0.1.11",
999
950
  "prettier": "^2.8.3",
1000
951
  "puppeteer": "^19.7.2",
1001
952
  "pyodide": "^0.24.1",
1002
953
  "redis": "^4.6.6",
1003
954
  "release-it": "^15.10.1",
1004
- "replicate": "^0.18.0",
1005
955
  "rimraf": "^5.0.1",
1006
956
  "rollup": "^3.19.1",
1007
957
  "sonix-speech-recognition": "^2.1.1",
1008
- "sqlite3": "^5.1.4",
1009
958
  "srt-parser-2": "^1.2.2",
1010
959
  "ts-jest": "^29.1.0",
1011
960
  "typeorm": "^0.3.12",
1012
961
  "typescript": "~5.1.6",
1013
- "typesense": "^1.5.3",
1014
- "usearch": "^1.1.1",
1015
962
  "vectordb": "^0.1.4",
1016
- "voy-search": "0.6.2",
1017
963
  "weaviate-ts-client": "^1.4.0",
1018
964
  "web-auth-library": "^1.0.3",
1019
965
  "youtube-transcript": "^1.0.6",
1020
966
  "youtubei.js": "^5.8.0"
1021
967
  },
1022
968
  "peerDependencies": {
1023
- "@aws-sdk/client-lambda": "^3.310.0",
1024
969
  "@aws-sdk/client-s3": "^3.310.0",
1025
970
  "@aws-sdk/client-sagemaker-runtime": "^3.310.0",
1026
971
  "@aws-sdk/client-sfn": "^3.310.0",
1027
972
  "@aws-sdk/credential-provider-node": "^3.388.0",
1028
973
  "@azure/storage-blob": "^12.15.0",
1029
- "@clickhouse/client": "^0.2.5",
1030
- "@cloudflare/ai": "^1.0.12",
1031
- "@elastic/elasticsearch": "^8.4.0",
1032
- "@getmetal/metal-sdk": "*",
1033
- "@getzep/zep-js": "^0.9.0",
1034
974
  "@gomomento/sdk": "^1.51.1",
1035
975
  "@gomomento/sdk-core": "^1.51.1",
1036
976
  "@gomomento/sdk-web": "^1.51.1",
1037
977
  "@google-ai/generativelanguage": "^0.2.1",
1038
978
  "@google-cloud/storage": "^6.10.1",
1039
- "@gradientai/nodejs-sdk": "^1.2.0",
1040
- "@huggingface/inference": "^2.6.4",
1041
- "@mozilla/readability": "*",
1042
979
  "@notionhq/client": "^2.2.10",
1043
- "@opensearch-project/opensearch": "*",
1044
980
  "@pinecone-database/pinecone": "^1.1.0",
1045
- "@planetscale/database": "^1.8.0",
1046
- "@qdrant/js-client-rest": "^1.2.0",
1047
- "@raycast/api": "^1.55.2",
1048
- "@rockset/client": "^0.9.1",
1049
- "@smithy/eventstream-codec": "^2.0.5",
1050
- "@smithy/protocol-http": "^3.0.6",
1051
- "@smithy/signature-v4": "^2.0.10",
1052
- "@smithy/util-utf8": "^2.0.0",
1053
- "@supabase/postgrest-js": "^1.1.1",
1054
981
  "@supabase/supabase-js": "^2.10.0",
1055
- "@tensorflow-models/universal-sentence-encoder": "*",
1056
- "@tensorflow/tfjs-converter": "*",
1057
- "@tensorflow/tfjs-core": "*",
1058
- "@upstash/redis": "^1.20.6",
1059
982
  "@vercel/kv": "^0.2.3",
1060
- "@vercel/postgres": "^0.5.0",
1061
- "@writerai/writer-sdk": "^0.40.2",
1062
983
  "@xata.io/client": "^0.28.0",
1063
- "@xenova/transformers": "^2.5.4",
1064
- "@zilliz/milvus2-sdk-node": ">=2.2.7",
1065
984
  "apify-client": "^2.7.1",
1066
985
  "assemblyai": "^2.0.2",
1067
986
  "axios": "*",
1068
- "cassandra-driver": "^4.7.2",
1069
987
  "cheerio": "^1.0.0-rc.12",
1070
988
  "chromadb": "*",
1071
- "closevector-common": "0.1.0-alpha.1",
1072
- "closevector-node": "0.1.0-alpha.10",
1073
- "closevector-web": "0.1.0-alpha.16",
1074
- "cohere-ai": ">=6.0.0",
1075
989
  "convex": "^1.3.1",
1076
990
  "d3-dsv": "^2.0.0",
1077
991
  "epub2": "^3.0.1",
1078
- "faiss-node": "^0.5.1",
1079
992
  "fast-xml-parser": "^4.2.7",
1080
- "firebase-admin": "^11.9.0",
1081
993
  "google-auth-library": "^8.9.0",
1082
994
  "googleapis": "^126.0.1",
1083
- "hnswlib-node": "^1.4.2",
1084
995
  "html-to-text": "^9.0.5",
1085
996
  "ignore": "^5.2.0",
1086
997
  "ioredis": "^5.3.2",
1087
998
  "jsdom": "*",
1088
- "llmonitor": "^0.5.9",
1089
- "lodash": "^4.17.21",
1090
999
  "mammoth": "*",
1091
1000
  "mongodb": "^5.2.0",
1092
- "mysql2": "^3.3.3",
1093
- "neo4j-driver": "*",
1094
1001
  "node-llama-cpp": "*",
1095
1002
  "notion-to-md": "^3.1.0",
1096
1003
  "officeparser": "^4.0.4",
1097
1004
  "pdf-parse": "1.1.1",
1098
1005
  "peggy": "^3.0.2",
1099
- "pg": "^8.11.0",
1100
- "pg-copy-streams": "^6.0.5",
1101
- "pickleparser": "^0.2.1",
1102
1006
  "playwright": "^1.32.1",
1103
- "portkey-ai": "^0.1.11",
1104
1007
  "puppeteer": "^19.7.2",
1105
1008
  "pyodide": "^0.24.1",
1106
1009
  "redis": "^4.6.4",
1107
- "replicate": "^0.18.0",
1108
1010
  "sonix-speech-recognition": "^2.1.1",
1109
1011
  "srt-parser-2": "^1.2.2",
1110
1012
  "typeorm": "^0.3.12",
1111
- "typesense": "^1.5.3",
1112
- "usearch": "^1.1.1",
1113
1013
  "vectordb": "^0.1.4",
1114
- "voy-search": "0.6.2",
1115
1014
  "weaviate-ts-client": "^1.4.0",
1116
1015
  "web-auth-library": "^1.0.3",
1117
1016
  "ws": "^8.14.2",
@@ -1119,9 +1018,6 @@
1119
1018
  "youtubei.js": "^5.8.0"
1120
1019
  },
1121
1020
  "peerDependenciesMeta": {
1122
- "@aws-sdk/client-lambda": {
1123
- "optional": true
1124
- },
1125
1021
  "@aws-sdk/client-s3": {
1126
1022
  "optional": true
1127
1023
  },
@@ -1137,21 +1033,6 @@
1137
1033
  "@azure/storage-blob": {
1138
1034
  "optional": true
1139
1035
  },
1140
- "@clickhouse/client": {
1141
- "optional": true
1142
- },
1143
- "@cloudflare/ai": {
1144
- "optional": true
1145
- },
1146
- "@elastic/elasticsearch": {
1147
- "optional": true
1148
- },
1149
- "@getmetal/metal-sdk": {
1150
- "optional": true
1151
- },
1152
- "@getzep/zep-js": {
1153
- "optional": true
1154
- },
1155
1036
  "@gomomento/sdk": {
1156
1037
  "optional": true
1157
1038
  },
@@ -1167,84 +1048,21 @@
1167
1048
  "@google-cloud/storage": {
1168
1049
  "optional": true
1169
1050
  },
1170
- "@gradientai/nodejs-sdk": {
1171
- "optional": true
1172
- },
1173
- "@huggingface/inference": {
1174
- "optional": true
1175
- },
1176
- "@mozilla/readability": {
1177
- "optional": true
1178
- },
1179
1051
  "@notionhq/client": {
1180
1052
  "optional": true
1181
1053
  },
1182
- "@opensearch-project/opensearch": {
1183
- "optional": true
1184
- },
1185
1054
  "@pinecone-database/pinecone": {
1186
1055
  "optional": true
1187
1056
  },
1188
- "@planetscale/database": {
1189
- "optional": true
1190
- },
1191
- "@qdrant/js-client-rest": {
1192
- "optional": true
1193
- },
1194
- "@raycast/api": {
1195
- "optional": true
1196
- },
1197
- "@rockset/client": {
1198
- "optional": true
1199
- },
1200
- "@smithy/eventstream-codec": {
1201
- "optional": true
1202
- },
1203
- "@smithy/protocol-http": {
1204
- "optional": true
1205
- },
1206
- "@smithy/signature-v4": {
1207
- "optional": true
1208
- },
1209
- "@smithy/util-utf8": {
1210
- "optional": true
1211
- },
1212
- "@supabase/postgrest-js": {
1213
- "optional": true
1214
- },
1215
1057
  "@supabase/supabase-js": {
1216
1058
  "optional": true
1217
1059
  },
1218
- "@tensorflow-models/universal-sentence-encoder": {
1219
- "optional": true
1220
- },
1221
- "@tensorflow/tfjs-converter": {
1222
- "optional": true
1223
- },
1224
- "@tensorflow/tfjs-core": {
1225
- "optional": true
1226
- },
1227
- "@upstash/redis": {
1228
- "optional": true
1229
- },
1230
1060
  "@vercel/kv": {
1231
1061
  "optional": true
1232
1062
  },
1233
- "@vercel/postgres": {
1234
- "optional": true
1235
- },
1236
- "@writerai/writer-sdk": {
1237
- "optional": true
1238
- },
1239
1063
  "@xata.io/client": {
1240
1064
  "optional": true
1241
1065
  },
1242
- "@xenova/transformers": {
1243
- "optional": true
1244
- },
1245
- "@zilliz/milvus2-sdk-node": {
1246
- "optional": true
1247
- },
1248
1066
  "apify-client": {
1249
1067
  "optional": true
1250
1068
  },
@@ -1254,27 +1072,12 @@
1254
1072
  "axios": {
1255
1073
  "optional": true
1256
1074
  },
1257
- "cassandra-driver": {
1258
- "optional": true
1259
- },
1260
1075
  "cheerio": {
1261
1076
  "optional": true
1262
1077
  },
1263
1078
  "chromadb": {
1264
1079
  "optional": true
1265
1080
  },
1266
- "closevector-common": {
1267
- "optional": true
1268
- },
1269
- "closevector-node": {
1270
- "optional": true
1271
- },
1272
- "closevector-web": {
1273
- "optional": true
1274
- },
1275
- "cohere-ai": {
1276
- "optional": true
1277
- },
1278
1081
  "convex": {
1279
1082
  "optional": true
1280
1083
  },
@@ -1290,18 +1093,12 @@
1290
1093
  "fast-xml-parser": {
1291
1094
  "optional": true
1292
1095
  },
1293
- "firebase-admin": {
1294
- "optional": true
1295
- },
1296
1096
  "google-auth-library": {
1297
1097
  "optional": true
1298
1098
  },
1299
1099
  "googleapis": {
1300
1100
  "optional": true
1301
1101
  },
1302
- "hnswlib-node": {
1303
- "optional": true
1304
- },
1305
1102
  "html-to-text": {
1306
1103
  "optional": true
1307
1104
  },
@@ -1314,24 +1111,12 @@
1314
1111
  "jsdom": {
1315
1112
  "optional": true
1316
1113
  },
1317
- "llmonitor": {
1318
- "optional": true
1319
- },
1320
- "lodash": {
1321
- "optional": true
1322
- },
1323
1114
  "mammoth": {
1324
1115
  "optional": true
1325
1116
  },
1326
1117
  "mongodb": {
1327
1118
  "optional": true
1328
1119
  },
1329
- "mysql2": {
1330
- "optional": true
1331
- },
1332
- "neo4j-driver": {
1333
- "optional": true
1334
- },
1335
1120
  "node-llama-cpp": {
1336
1121
  "optional": true
1337
1122
  },
@@ -1347,21 +1132,9 @@
1347
1132
  "peggy": {
1348
1133
  "optional": true
1349
1134
  },
1350
- "pg": {
1351
- "optional": true
1352
- },
1353
- "pg-copy-streams": {
1354
- "optional": true
1355
- },
1356
- "pickleparser": {
1357
- "optional": true
1358
- },
1359
1135
  "playwright": {
1360
1136
  "optional": true
1361
1137
  },
1362
- "portkey-ai": {
1363
- "optional": true
1364
- },
1365
1138
  "puppeteer": {
1366
1139
  "optional": true
1367
1140
  },
@@ -1371,9 +1144,6 @@
1371
1144
  "redis": {
1372
1145
  "optional": true
1373
1146
  },
1374
- "replicate": {
1375
- "optional": true
1376
- },
1377
1147
  "sonix-speech-recognition": {
1378
1148
  "optional": true
1379
1149
  },
@@ -1383,18 +1153,9 @@
1383
1153
  "typeorm": {
1384
1154
  "optional": true
1385
1155
  },
1386
- "typesense": {
1387
- "optional": true
1388
- },
1389
- "usearch": {
1390
- "optional": true
1391
- },
1392
1156
  "vectordb": {
1393
1157
  "optional": true
1394
1158
  },
1395
- "voy-search": {
1396
- "optional": true
1397
- },
1398
1159
  "weaviate-ts-client": {
1399
1160
  "optional": true
1400
1161
  },
@@ -1413,9 +1174,9 @@
1413
1174
  },
1414
1175
  "dependencies": {
1415
1176
  "@anthropic-ai/sdk": "^0.9.1",
1416
- "@langchain/community": "~0.0.0",
1417
- "@langchain/core": "~0.0.11-rc.1",
1418
- "@langchain/openai": "~0.0.2-rc.0",
1177
+ "@langchain/community": "~0.0.1-rc.2",
1178
+ "@langchain/core": "~0.0.11-rc.2",
1179
+ "@langchain/openai": "~0.0.2-rc.1",
1419
1180
  "binary-extensions": "^2.2.0",
1420
1181
  "expr-eval": "^2.0.2",
1421
1182
  "js-tiktoken": "^1.0.7",
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,135 +0,0 @@
1
- import type { OpenAIClient } from "@langchain/openai";
2
- import { TiktokenModel } from "js-tiktoken/lite";
3
- import { BaseLanguageModelCallOptions } from "../base_language/index.js";
4
- export type { TiktokenModel };
5
- export declare interface OpenAIBaseInput {
6
- /** Sampling temperature to use */
7
- temperature: number;
8
- /**
9
- * Maximum number of tokens to generate in the completion. -1 returns as many
10
- * tokens as possible given the prompt and the model's maximum context size.
11
- */
12
- maxTokens?: number;
13
- /** Total probability mass of tokens to consider at each step */
14
- topP: number;
15
- /** Penalizes repeated tokens according to frequency */
16
- frequencyPenalty: number;
17
- /** Penalizes repeated tokens */
18
- presencePenalty: number;
19
- /** Number of completions to generate for each prompt */
20
- n: number;
21
- /** Dictionary used to adjust the probability of specific tokens being generated */
22
- logitBias?: Record<string, number>;
23
- /** Unique string identifier representing your end-user, which can help OpenAI to monitor and detect abuse. */
24
- user?: string;
25
- /** Whether to stream the results or not. Enabling disables tokenUsage reporting */
26
- streaming: boolean;
27
- /** Model name to use */
28
- modelName: string;
29
- /** Holds any additional parameters that are valid to pass to {@link
30
- * https://platform.openai.com/docs/api-reference/completions/create |
31
- * `openai.createCompletion`} that are not explicitly specified on this class.
32
- */
33
- modelKwargs?: Record<string, any>;
34
- /** List of stop words to use when generating */
35
- stop?: string[];
36
- /**
37
- * Timeout to use when making requests to OpenAI.
38
- */
39
- timeout?: number;
40
- /**
41
- * API key to use when making requests to OpenAI. Defaults to the value of
42
- * `OPENAI_API_KEY` environment variable.
43
- */
44
- openAIApiKey?: string;
45
- }
46
- export type OpenAICoreRequestOptions<Req extends object = Record<string, unknown>> = {
47
- path?: string;
48
- query?: Req | undefined;
49
- body?: Req | undefined;
50
- headers?: Record<string, string | null | undefined> | undefined;
51
- maxRetries?: number;
52
- stream?: boolean | undefined;
53
- timeout?: number;
54
- httpAgent?: any;
55
- signal?: AbortSignal | undefined | null;
56
- idempotencyKey?: string;
57
- };
58
- export interface OpenAICallOptions extends BaseLanguageModelCallOptions {
59
- /**
60
- * Additional options to pass to the underlying axios request.
61
- */
62
- options?: OpenAICoreRequestOptions;
63
- }
64
- /**
65
- * Input to OpenAI class.
66
- */
67
- export declare interface OpenAIInput extends OpenAIBaseInput {
68
- /** Generates `bestOf` completions server side and returns the "best" */
69
- bestOf?: number;
70
- /** Batch size to use when passing multiple documents to generate */
71
- batchSize: number;
72
- }
73
- /**
74
- * @deprecated Use "baseURL", "defaultHeaders", and "defaultParams" instead.
75
- */
76
- export interface LegacyOpenAIInput {
77
- /** @deprecated Use baseURL instead */
78
- basePath?: string;
79
- /** @deprecated Use defaultHeaders and defaultQuery instead */
80
- baseOptions?: {
81
- headers?: Record<string, string>;
82
- params?: Record<string, string>;
83
- };
84
- }
85
- export interface OpenAIChatInput extends OpenAIBaseInput {
86
- /** ChatGPT messages to pass as a prefix to the prompt */
87
- prefixMessages?: OpenAIClient.Chat.CreateChatCompletionRequestMessage[];
88
- }
89
- export declare interface AzureOpenAIInput {
90
- /**
91
- * API version to use when making requests to Azure OpenAI.
92
- */
93
- azureOpenAIApiVersion?: string;
94
- /**
95
- * API key to use when making requests to Azure OpenAI.
96
- */
97
- azureOpenAIApiKey?: string;
98
- /**
99
- * Azure OpenAI API instance name to use when making requests to Azure OpenAI.
100
- * this is the name of the instance you created in the Azure portal.
101
- * e.g. "my-openai-instance"
102
- * this will be used in the endpoint URL: https://my-openai-instance.openai.azure.com/openai/deployments/{DeploymentName}/
103
- */
104
- azureOpenAIApiInstanceName?: string;
105
- /**
106
- * Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.
107
- * This is the name of the deployment you created in the Azure portal.
108
- * e.g. "my-openai-deployment"
109
- * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
110
- */
111
- azureOpenAIApiDeploymentName?: string;
112
- /**
113
- * Azure OpenAI API deployment name to use for embedding when making requests to Azure OpenAI.
114
- * This is the name of the deployment you created in the Azure portal.
115
- * This will fallback to azureOpenAIApiDeploymentName if not provided.
116
- * e.g. "my-openai-deployment"
117
- * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
118
- */
119
- azureOpenAIApiEmbeddingsDeploymentName?: string;
120
- /**
121
- * Azure OpenAI API deployment name to use for completions when making requests to Azure OpenAI.
122
- * Completions are only available for gpt-3.5-turbo and text-davinci-003 deployments.
123
- * This is the name of the deployment you created in the Azure portal.
124
- * This will fallback to azureOpenAIApiDeploymentName if not provided.
125
- * e.g. "my-openai-deployment"
126
- * this will be used in the endpoint URL: https://{InstanceName}.openai.azure.com/openai/deployments/my-openai-deployment/
127
- */
128
- azureOpenAIApiCompletionsDeploymentName?: string;
129
- /**
130
- * Custom endpoint for Azure OpenAI API. This is useful in case you have a deployment in another region.
131
- * e.g. setting this value to "https://westeurope.api.cognitive.microsoft.com/openai/deployments"
132
- * will be result in the endpoint URL: https://westeurope.api.cognitive.microsoft.com/openai/deployments/{DeploymentName}/
133
- */
134
- azureOpenAIBasePath?: string;
135
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.chunkArray = void 0;
4
- const chunkArray = (arr, chunkSize) => arr.reduce((chunks, elem, index) => {
5
- const chunkIndex = Math.floor(index / chunkSize);
6
- const chunk = chunks[chunkIndex] || [];
7
- // eslint-disable-next-line no-param-reassign
8
- chunks[chunkIndex] = chunk.concat([elem]);
9
- return chunks;
10
- }, []);
11
- exports.chunkArray = chunkArray;
@@ -1 +0,0 @@
1
- export declare const chunkArray: <T>(arr: T[], chunkSize: number) => T[][];
@@ -1,7 +0,0 @@
1
- export const chunkArray = (arr, chunkSize) => arr.reduce((chunks, elem, index) => {
2
- const chunkIndex = Math.floor(index / chunkSize);
3
- const chunk = chunks[chunkIndex] || [];
4
- // eslint-disable-next-line no-param-reassign
5
- chunks[chunkIndex] = chunk.concat([elem]);
6
- return chunks;
7
- }, []);