Compare commits

...

8 Commits

Author SHA1 Message Date
Alex Yang 8dbe371003 fix: version 2024-06-05 13:32:09 -07:00
Alex Yang fd27dfd56b fix: lock 2024-06-05 13:18:21 -07:00
Alex Yang 223d77c3cb Merge remote-tracking branch 'refs/remotes/upstream/main' into update-packages-20240528
# Conflicts:
#	packages/core/package.json
#	pnpm-lock.yaml
2024-06-05 13:17:56 -07:00
Alex Yang d5cce5d90e ci: fail-not-fast 2024-06-05 12:59:53 -07:00
Yi Ding bc7a1f3daf Merge branch 'main' into update-packages-20240528 2024-06-04 17:46:59 -07:00
Yi Ding e7a7a36dd4 pnpm up 2024-06-04 17:43:42 -07:00
Yi Ding c989c8ec87 update mongodb 2024-06-04 17:37:38 -07:00
Yi Ding 669b5afab2 package update 2024-05-29 03:45:00 -07:00
7 changed files with 1407 additions and 717 deletions
+1
View File
@@ -85,6 +85,7 @@ jobs:
if-no-files-found: error
e2e-core-examples:
strategy:
fail-fast: false
matrix:
packages:
- cloudflare-worker-agent
+9 -9
View File
@@ -4,22 +4,22 @@
"version": "0.0.4",
"dependencies": {
"@aws-crypto/sha256-js": "^5.2.0",
"@datastax/astra-db-ts": "^1.1.0",
"@datastax/astra-db-ts": "^1.2.1",
"@notionhq/client": "^2.2.15",
"@pinecone-database/pinecone": "^2.2.0",
"@pinecone-database/pinecone": "^2.2.2",
"@zilliz/milvus2-sdk-node": "^2.4.2",
"chromadb": "^1.7.3",
"commander": "^12.0.0",
"chromadb": "^1.8.1",
"commander": "^12.1.0",
"dotenv": "^16.4.5",
"js-tiktoken": "^1.0.11",
"llamaindex": "*",
"mongodb": "^6.6.1",
"js-tiktoken": "^1.0.12",
"llamaindex": "^0.3.14",
"mongodb": "^6.7.0",
"pathe": "^1.1.2"
},
"devDependencies": {
"@types/node": "^20.12.11",
"@types/node": "^20.14.1",
"ts-node": "^10.9.2",
"tsx": "^4.9.3",
"tsx": "^4.11.2",
"typescript": "^5.4.5"
},
"scripts": {
+3 -3
View File
@@ -19,15 +19,15 @@
"new-snapshot": "pnpm run build:release && changeset version --snapshot"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@changesets/cli": "^2.27.5",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"eslint": "^8.57.0",
"eslint-config-next": "^14.2.3",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^1.13.3",
"eslint-plugin-react": "7.34.1",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"lint-staged": "^15.2.5",
"madge": "^7.0.0",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
+22 -22
View File
@@ -21,45 +21,45 @@
"llamaindex"
],
"dependencies": {
"@anthropic-ai/sdk": "^0.20.9",
"@anthropic-ai/sdk": "^0.21.1",
"@aws-crypto/sha256-js": "^5.2.0",
"@datastax/astra-db-ts": "^1.1.0",
"@google-cloud/vertexai": "^1.1.0",
"@google/generative-ai": "^0.11.0",
"@grpc/grpc-js": "^1.10.7",
"@huggingface/inference": "^2.6.7",
"@datastax/astra-db-ts": "^1.2.1",
"@google-cloud/vertexai": "^1.2.0",
"@google/generative-ai": "^0.12.0",
"@grpc/grpc-js": "^1.10.8",
"@huggingface/inference": "^2.7.0",
"@llamaindex/cloud": "0.0.5",
"@llamaindex/env": "workspace:*",
"@mistralai/mistralai": "^0.2.0",
"@pinecone-database/pinecone": "^2.2.0",
"@mistralai/mistralai": "^0.4.0",
"@pinecone-database/pinecone": "^2.2.2",
"@qdrant/js-client-rest": "^1.9.0",
"@types/lodash": "^4.17.1",
"@types/lodash": "^4.17.4",
"@types/papaparse": "^5.3.14",
"@types/pg": "^8.11.6",
"@xenova/transformers": "^2.17.1",
"@xenova/transformers": "^2.17.2",
"@zilliz/milvus2-sdk-node": "^2.4.2",
"ajv": "^8.13.0",
"assemblyai": "^4.4.2",
"chromadb": "~1.7.3",
"cohere-ai": "^7.9.5",
"js-tiktoken": "^1.0.11",
"ajv": "^8.16.0",
"assemblyai": "^4.4.5",
"chromadb": "1.8.1",
"cohere-ai": "7.9.5",
"js-tiktoken": "^1.0.12",
"lodash": "^4.17.21",
"magic-bytes.js": "^1.10.0",
"mammoth": "^1.7.2",
"md-utils-ts": "^2.0.0",
"mongodb": "^6.6.1",
"mongodb": "^6.7.0",
"notion-md-crawler": "^1.0.0",
"openai": "^4.46.0",
"openai": "^4.48.1",
"papaparse": "^5.4.1",
"pathe": "^1.1.2",
"pdf2json": "3.0.5",
"pg": "^8.11.5",
"pdf2json": "3.1.3",
"pg": "^8.12.0",
"pgvector": "^0.1.8",
"portkey-ai": "^0.1.16",
"rake-modified": "^1.0.8",
"string-strip-html": "^13.4.8",
"wikipedia": "^2.1.2",
"wink-nlp": "^2.2.2"
"wink-nlp": "^2.3.0"
},
"peerDependencies": {
"@notionhq/client": "^2.2.15"
@@ -67,9 +67,9 @@
"devDependencies": {
"@notionhq/client": "^2.2.15",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.5.5",
"@swc/core": "^1.5.24",
"concurrently": "^8.2.2",
"glob": "^10.3.12",
"glob": "^10.4.1",
"typescript": "^5.4.5"
},
"engines": {
+39 -5
View File
@@ -1,7 +1,4 @@
import {
HfInference,
type Options as HfInferenceOptions,
} from "@huggingface/inference";
import { HfInference } from "@huggingface/inference";
import type {
PreTrainedModel,
PreTrainedTokenizer,
@@ -20,12 +17,49 @@ import type {
} from "./types.js";
import { streamConverter, wrapLLMEvent } from "./utils.js";
// TODO workaround issue with @huggingface/inference@2.7.0
interface HfInferenceOptions {
/**
* (Default: true) Boolean. If a request 503s and wait_for_model is set to false, the request will be retried with the same parameters but with wait_for_model set to true.
*/
retry_on_error?: boolean;
/**
* (Default: true). Boolean. There is a cache layer on Inference API (serverless) to speedup requests we have already seen. Most models can use those results as is as models are deterministic (meaning the results will be the same anyway). However if you use a non deterministic model, you can set this parameter to prevent the caching mechanism from being used resulting in a real new query.
*/
use_cache?: boolean;
/**
* (Default: false). Boolean. Do not load the model if it's not already available.
*/
dont_load_model?: boolean;
/**
* (Default: false). Boolean to use GPU instead of CPU for inference (requires Startup plan at least).
*/
use_gpu?: boolean;
/**
* (Default: false) Boolean. If the model is not ready, wait for it instead of receiving 503. It limits the number of requests required to get your inference done. It is advised to only set this flag to true after receiving a 503 error as it will limit hanging in your application to known places.
*/
wait_for_model?: boolean;
/**
* Custom fetch function to use instead of the default one, for example to use a proxy or edit headers.
*/
fetch?: typeof fetch;
/**
* Abort Controller signal to use for request interruption.
*/
signal?: AbortSignal;
/**
* (Default: "same-origin"). String | Boolean. Credentials to use for the request. If this is a string, it will be passed straight on. If it's a boolean, true will be "include" and false will not send credentials at all.
*/
includeCredentials?: string | boolean;
}
const DEFAULT_PARAMS = {
temperature: 0.1,
topP: 1,
maxTokens: undefined,
contextWindow: 3900,
};
export type HFConfig = Partial<typeof DEFAULT_PARAMS> &
HfInferenceOptions & {
model: string;
@@ -139,7 +173,7 @@ export class HuggingFaceInferenceAPI extends BaseLLM {
inputs: this.messagesToPrompt(params.messages),
parameters: this.metadata,
});
yield* streamConverter(stream, (chunk) => ({
yield* streamConverter(stream, (chunk: any) => ({
delta: chunk.token.text,
raw: chunk,
}));
+1 -1
View File
@@ -21,7 +21,7 @@ export class PDFReader implements BaseReader {
async function readPDF(data: Buffer): Promise<string[]> {
const parser = await import("pdf2json").then(
({ default: Pdfparser }) => new Pdfparser(null, 1),
({ default: Pdfparser }) => new Pdfparser(null, true),
);
const text = await new Promise<string>((resolve, reject) => {
parser.on("pdfParser_dataError", (error) => {
+1332 -677
View File
File diff suppressed because it is too large Load Diff