-
Notifications
You must be signed in to change notification settings - Fork 183
fix typing issue and add typing test for llamaindexserver templates #613
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
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3e42125
try testing for llamaindexserver
leehuwuj 5301828
Enhance TypeScript tests for dependency resolution by introducing tem…
leehuwuj 0c20b9f
refactor template structure
leehuwuj a8b1894
fix package conflict
leehuwuj 4e0f61b
add tests for python
leehuwuj ec8f6e8
fix python mypy
leehuwuj bec98ed
use matrix for templateType
leehuwuj 39a4ee5
add changeset
leehuwuj 1780895
add removing data.ts for artifacts template
leehuwuj 336e3e3
don't ask llamacloud for unsupported use case and skip test
leehuwuj 53ea76a
Enhance tests for LlamaIndexServer by adding conditional skips based …
leehuwuj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ build/ | |
.next/ | ||
out/ | ||
packages/server/server/ | ||
**/playwright-report/ | ||
**/test-results/ | ||
|
||
# Python | ||
python/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
packages/create-llama/templates/components/use-cases/typescript/agentic_rag/src/generate.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { SimpleDirectoryReader } from "@llamaindex/readers/directory"; | ||
import "dotenv/config"; | ||
import { storageContextFromDefaults, VectorStoreIndex } from "llamaindex"; | ||
import { initSettings } from "./app/settings"; | ||
|
||
async function generateDatasource() { | ||
console.log(`Generating storage context...`); | ||
// Split documents, create embeddings and store them in the storage context | ||
const storageContext = await storageContextFromDefaults({ | ||
persistDir: "storage", | ||
}); | ||
// load documents from current directory into an index | ||
const reader = new SimpleDirectoryReader(); | ||
const documents = await reader.loadData("data"); | ||
|
||
await VectorStoreIndex.fromDocuments(documents, { | ||
storageContext, | ||
}); | ||
console.log("Storage context successfully generated."); | ||
} | ||
|
||
(async () => { | ||
const args = process.argv.slice(2); | ||
const command = args[0]; | ||
|
||
initSettings(); | ||
|
||
if (command === "ui") { | ||
console.error("This project doesn't use any custom UI."); | ||
return; | ||
} else { | ||
if (command !== "datasource") { | ||
console.error( | ||
`Unrecognized command: ${command}. Generating datasource by default.`, | ||
); | ||
} | ||
await generateDatasource(); | ||
} | ||
})(); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
...s/create-llama/templates/components/use-cases/typescript/financial_report/src/generate.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { SimpleDirectoryReader } from "@llamaindex/readers/directory"; | ||
import "dotenv/config"; | ||
import { storageContextFromDefaults, VectorStoreIndex } from "llamaindex"; | ||
import { initSettings } from "./app/settings"; | ||
|
||
async function generateDatasource() { | ||
console.log(`Generating storage context...`); | ||
// Split documents, create embeddings and store them in the storage context | ||
const storageContext = await storageContextFromDefaults({ | ||
persistDir: "storage", | ||
}); | ||
// load documents from current directory into an index | ||
const reader = new SimpleDirectoryReader(); | ||
const documents = await reader.loadData("data"); | ||
|
||
await VectorStoreIndex.fromDocuments(documents, { | ||
storageContext, | ||
}); | ||
console.log("Storage context successfully generated."); | ||
} | ||
|
||
(async () => { | ||
const args = process.argv.slice(2); | ||
const command = args[0]; | ||
|
||
initSettings(); | ||
|
||
if (command === "ui") { | ||
console.error("This project doesn't use any custom UI."); | ||
return; | ||
} else { | ||
if (command !== "datasource") { | ||
console.error( | ||
`Unrecognized command: ${command}. Generating datasource by default.`, | ||
); | ||
} | ||
await generateDatasource(); | ||
} | ||
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.