Skip to content

bump: use latest LITS #343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/modern-lemons-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-llama": patch
---

bump: use LlamaIndexTS 0.6.18
2 changes: 1 addition & 1 deletion helpers/env-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const getVectorDBEnvs = (
{
name: "PG_CONNECTION_STRING",
description:
"For generating a connection URI, see https://docs.timescale.com/use-timescale/latest/services/create-a-service\nThe PostgreSQL connection string.",
"For generating a connection URI, see https://supabase.com/vector\nThe PostgreSQL connection string.",
},
];

Expand Down
4 changes: 2 additions & 2 deletions templates/components/engines/typescript/agent/chat.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
BaseChatEngine,
BaseToolWithCall,
ChatEngine,
OpenAIAgent,
QueryEngineTool,
} from "llamaindex";
Expand Down Expand Up @@ -45,7 +45,7 @@ export async function createChatEngine(documentIds?: string[], params?: any) {
const agent = new OpenAIAgent({
tools,
systemPrompt: process.env.SYSTEM_PROMPT,
}) as unknown as ChatEngine;
}) as unknown as BaseChatEngine;

return agent;
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { MetadataFilter, MetadataFilters } from "llamaindex";
import { CloudRetrieveParams, MetadataFilter } from "llamaindex";

export function generateFilters(documentIds: string[]): MetadataFilters {
export function generateFilters(documentIds: string[]) {
// public documents don't have the "private" field or it's set to "false"
const publicDocumentsFilter: MetadataFilter = {
key: "private",
operator: "is_empty",
};

// if no documentIds are provided, only retrieve information from public documents
if (!documentIds.length) return { filters: [publicDocumentsFilter] };
if (!documentIds.length)
return {
filters: [publicDocumentsFilter],
} as CloudRetrieveParams["filters"];

const privateDocumentsFilter: MetadataFilter = {
key: "file_id", // Note: LLamaCloud uses "file_id" to reference private document ids as "doc_id" is a restricted field in LlamaCloud
Expand All @@ -20,5 +23,5 @@ export function generateFilters(documentIds: string[]): MetadataFilters {
return {
filters: [publicDocumentsFilter, privateDocumentsFilter],
condition: "or",
};
} as CloudRetrieveParams["filters"];
}
4 changes: 3 additions & 1 deletion templates/components/vectordbs/typescript/pg/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ async function loadAndIndex() {

// create postgres vector store
const vectorStore = new PGVectorStore({
connectionString: process.env.PG_CONNECTION_STRING,
clientConfig: {
connectionString: process.env.PG_CONNECTION_STRING,
},
schemaName: PGVECTOR_SCHEMA,
tableName: PGVECTOR_TABLE,
});
Expand Down
4 changes: 3 additions & 1 deletion templates/components/vectordbs/typescript/pg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import {
export async function getDataSource(params?: any) {
checkRequiredEnvVars();
const pgvs = new PGVectorStore({
connectionString: process.env.PG_CONNECTION_STRING,
clientConfig: {
connectionString: process.env.PG_CONNECTION_STRING,
},
schemaName: PGVECTOR_SCHEMA,
tableName: PGVECTOR_TABLE,
});
Expand Down
2 changes: 1 addition & 1 deletion templates/types/streaming/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dotenv": "^16.3.1",
"duck-duck-scrape": "^2.2.5",
"express": "^4.18.2",
"llamaindex": "0.6.2",
"llamaindex": "0.6.18",
"pdf2json": "3.0.5",
"ajv": "^8.12.0",
"@e2b/code-interpreter": "0.0.9-beta.3",
Expand Down
2 changes: 1 addition & 1 deletion templates/types/streaming/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"duck-duck-scrape": "^2.2.5",
"formdata-node": "^6.0.3",
"got": "^14.4.1",
"llamaindex": "0.6.2",
"llamaindex": "0.6.18",
"lucide-react": "^0.294.0",
"next": "^14.2.4",
"react": "^18.2.0",
Expand Down
Loading