Compare commits

..

5 Commits

Author SHA1 Message Date
github-actions[bot] 1752463ee6 Release 0.5.14 (#1103)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-07 17:03:00 -07:00
Peter Goldstein c825a2f743 Add gpt-4o-mini to Azure. Add 2024-06-01 API version for Azure (#1102) 2024-08-06 14:23:28 +07:00
github-actions[bot] ba058dc8d4 Release 0.5.13 (#1100)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-08-02 09:50:07 -07:00
Philipp Serrer 04b2f8e062 fix: metadata should not be included after sentence splitter (#1099) 2024-08-02 09:22:04 -07:00
Alex Yang 62b874e14f fix: enforce no-base-to-string (#1097) 2024-08-01 14:05:19 -07:00
32 changed files with 169 additions and 26 deletions
+6 -1
View File
@@ -31,7 +31,12 @@ module.exports = {
"@typescript-eslint/ban-types": "off",
"no-array-constructor": "off",
"@typescript-eslint/no-array-constructor": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-base-to-string": [
"error",
{
ignoredTypeNames: ["Error", "RegExp", "URL", "URLSearchParams"],
},
],
"@typescript-eslint/no-duplicate-enum-values": "off",
"@typescript-eslint/no-duplicate-type-constituents": "off",
"@typescript-eslint/no-explicit-any": "off",
+13
View File
@@ -1,5 +1,18 @@
# docs
## 0.0.55
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
## 0.0.54
### Patch Changes
- llamaindex@0.5.13
## 0.0.53
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.53",
"version": "0.0.55",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
@@ -1,5 +1,20 @@
# @llamaindex/autotool-02-next-example
## 0.1.39
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
- @llamaindex/autotool@2.0.0
## 0.1.38
### Patch Changes
- llamaindex@0.5.13
- @llamaindex/autotool@2.0.0
## 0.1.37
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/autotool-02-next-example",
"private": true,
"version": "0.1.37",
"version": "0.1.39",
"scripts": {
"dev": "next dev",
"build": "next build",
+1 -1
View File
@@ -51,7 +51,7 @@
"unplugin": "^1.10.1"
},
"peerDependencies": {
"llamaindex": "^0.5.12",
"llamaindex": "^0.5.14",
"openai": "^4",
"typescript": "^4"
},
+7
View File
@@ -1,5 +1,12 @@
# @llamaindex/community
## 0.0.28
### Patch Changes
- Updated dependencies [04b2f8e]
- @llamaindex/core@0.1.7
## 0.0.27
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/community",
"description": "Community package for LlamaIndexTS",
"version": "0.0.27",
"version": "0.0.28",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/core
## 0.1.7
### Patch Changes
- 04b2f8e: Fix issue with metadata included after sentence splitter
## 0.1.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/core",
"type": "module",
"version": "0.1.6",
"version": "0.1.7",
"description": "LlamaIndex Core Module",
"exports": {
"./node-parser": {
+1 -1
View File
@@ -140,7 +140,7 @@ export abstract class MetadataAwareTextSplitter extends TextSplitter {
return nodes.reduce<TextNode[]>((allNodes, node) => {
const metadataStr = this.getMetadataString(node);
const splits = this.splitTextMetadataAware(
node.getContent(MetadataMode.ALL),
node.getContent(MetadataMode.NONE),
metadataStr,
);
return allNodes.concat(buildNodeFromSplits(splits, node));
+13
View File
@@ -1,5 +1,18 @@
# @llamaindex/experimental
## 0.0.64
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
## 0.0.63
### Patch Changes
- llamaindex@0.5.13
## 0.0.62
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/experimental",
"description": "Experimental package for LlamaIndexTS",
"version": "0.0.62",
"version": "0.0.64",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
@@ -162,18 +162,18 @@ export class JSONQueryEngine implements QueryEngine {
const schema = this.getSchemaContext();
const jsonPathResponseStr = await this.serviceContext.llm.complete({
const { text: jsonPathResponse } = await this.serviceContext.llm.complete({
prompt: this.jsonPathPrompt({ query, schema }),
});
if (this.verbose) {
console.log(
`> JSONPath Instructions:\n\`\`\`\n${jsonPathResponseStr}\n\`\`\`\n`,
`> JSONPath Instructions:\n\`\`\`\n${jsonPathResponse}\n\`\`\`\n`,
);
}
const jsonPathOutput = await this.outputProcessor({
llmOutput: jsonPathResponseStr.text,
llmOutput: jsonPathResponse,
jsonValue: this.jsonValue,
});
@@ -188,7 +188,7 @@ export class JSONQueryEngine implements QueryEngine {
prompt: this.responseSynthesisPrompt({
query,
jsonSchema: schema,
jsonPath: jsonPathResponseStr.text,
jsonPath: jsonPathResponse,
jsonPathValue: JSON.stringify(jsonPathOutput),
}),
});
@@ -199,7 +199,7 @@ export class JSONQueryEngine implements QueryEngine {
}
const responseMetadata = {
jsonPathResponseStr,
jsonPathResponse,
};
const response = EngineResponse.fromResponse(responseStr, false);
+13
View File
@@ -1,5 +1,18 @@
# llamaindex
## 0.5.14
### Patch Changes
- c825a2f: Add gpt-4o-mini to Azure. Add 2024-06-01 API version for Azure
## 0.5.13
### Patch Changes
- Updated dependencies [04b2f8e]
- @llamaindex/core@0.1.7
## 0.5.12
### Patch Changes
@@ -1,5 +1,18 @@
# @llamaindex/cloudflare-worker-agent-test
## 0.0.48
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
## 0.0.47
### Patch Changes
- llamaindex@0.5.13
## 0.0.46
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloudflare-worker-agent-test",
"version": "0.0.46",
"version": "0.0.48",
"type": "module",
"private": true,
"scripts": {
@@ -1,5 +1,18 @@
# @llamaindex/next-agent-test
## 0.1.48
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
## 0.1.47
### Patch Changes
- llamaindex@0.5.13
## 0.1.46
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-agent-test",
"version": "0.1.46",
"version": "0.1.48",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,18 @@
# test-edge-runtime
## 0.1.47
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
## 0.1.46
### Patch Changes
- llamaindex@0.5.13
## 0.1.45
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/nextjs-edge-runtime-test",
"version": "0.1.45",
"version": "0.1.47",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,18 @@
# @llamaindex/next-node-runtime
## 0.0.29
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
## 0.0.28
### Patch Changes
- llamaindex@0.5.13
## 0.0.27
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-node-runtime-test",
"version": "0.0.27",
"version": "0.0.29",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,18 @@
# @llamaindex/waku-query-engine-test
## 0.0.48
### Patch Changes
- Updated dependencies [c825a2f]
- llamaindex@0.5.14
## 0.0.47
### Patch Changes
- llamaindex@0.5.13
## 0.0.46
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/waku-query-engine-test",
"version": "0.0.46",
"version": "0.0.48",
"type": "module",
"private": true,
"scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "llamaindex",
"version": "0.5.12",
"version": "0.5.14",
"license": "MIT",
"type": "module",
"keywords": [
@@ -79,7 +79,7 @@ export class JinaAIEmbedding extends MultiModalEmbedding {
private async getImageInput(
image: ImageType,
): Promise<{ bytes: string } | { url: string }> {
if (isLocal(image)) {
if (isLocal(image) || image instanceof Blob) {
const base64 = await imageToDataUrl(image);
const bytes = base64.split(",")[1];
return { bytes };
@@ -133,7 +133,7 @@ export class RouterQueryEngine extends PromptMixin implements QueryEngine {
const responses: EngineResponse[] = [];
for (let i = 0; i < result.selections.length; i++) {
const engineInd = result.selections[i];
const logStr = `Selecting query engine ${engineInd}: ${result.selections[i]}.`;
const logStr = `Selecting query engine ${engineInd.index}: ${result.selections[i].index}.`;
if (this.verbose) {
console.log(logStr + "\n");
@@ -119,15 +119,15 @@ export class SubQuestionQueryEngine
return null;
}
const responseText = await queryEngine?.call?.({
const responseValue = await queryEngine?.call?.({
query: question,
});
if (!responseText) {
if (responseValue == null) {
return null;
}
const nodeText = `Sub question: ${question}\nResponse: ${responseText}`;
const nodeText = `Sub question: ${question}\nResponse: ${typeof responseValue === "string" ? responseValue : JSON.stringify(responseValue)}`;
const node = new TextNode({ text: nodeText });
return { node, score: 0 };
} catch (error) {
@@ -78,7 +78,7 @@ export class RelevancyEvaluator extends PromptMixin implements BaseEvaluator {
serviceContext: this.serviceContext,
});
const queryResponse = `Question: ${query}\nResponse: ${response}`;
const queryResponse = `Question: ${extractText(query)}\nResponse: ${response}`;
const queryEngine = index.asQueryEngine();
+6
View File
@@ -18,6 +18,7 @@ const ALL_AZURE_OPENAI_CHAT_MODELS = {
openAIModel: "gpt-3.5-turbo-16k",
},
"gpt-4o": { contextWindow: 128000, openAIModel: "gpt-4o" },
"gpt-4o-mini": { contextWindow: 128000, openAIModel: "gpt-4o-mini" },
"gpt-4": { contextWindow: 8192, openAIModel: "gpt-4" },
"gpt-4-32k": { contextWindow: 32768, openAIModel: "gpt-4-32k" },
"gpt-4-turbo": {
@@ -40,6 +41,10 @@ const ALL_AZURE_OPENAI_CHAT_MODELS = {
contextWindow: 128000,
openAIModel: "gpt-4o-2024-05-13",
},
"gpt-4o-mini-2024-07-18": {
contextWindow: 128000,
openAIModel: "gpt-4o-mini-2024-07-18",
},
};
const ALL_AZURE_OPENAI_EMBEDDING_MODELS = {
@@ -73,6 +78,7 @@ const ALL_AZURE_API_VERSIONS = [
"2024-03-01-preview",
"2024-04-01-preview",
"2024-05-01-preview",
"2024-06-01",
];
const DEFAULT_API_VERSION = "2023-05-15";
@@ -185,7 +185,7 @@ export class JSONReader<T extends JSONValue> extends FileReader {
return jsonStr;
} catch (e) {
throw new JSONStringifyError(
`Error stringifying JSON: ${e} in "${data}"`,
`Error stringifying JSON: ${e} in "${JSON.stringify(data)}"`,
);
}
}