-
Notifications
You must be signed in to change notification settings - Fork 183
feat: Add form filling use case #403
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 22 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
12f0eb1
add form filling multiagent template
leehuwuj 7e6692b
remove printing
leehuwuj 072e69f
wording
leehuwuj b2a26fd
update tool factory
leehuwuj ffbc757
fix typing
leehuwuj d6b1dcf
better handle tool response generator
leehuwuj ab3cad2
fix wrong update
leehuwuj 7788c89
use functioncallingllm
leehuwuj effc31d
Fix workflow issue in tool calling
leehuwuj fc3cf07
use default prompt if not set
leehuwuj dc425c6
update template
leehuwuj 44283cd
update readme
leehuwuj 4f1d22b
fix import
leehuwuj fcd6b4b
allow empty index
leehuwuj c02c977
update readme
leehuwuj 26bc985
update agent event typing
leehuwuj d9eb8ed
update agent event typing
leehuwuj 9887070
fix typing
leehuwuj b245eb5
enhance chat agent event component
leehuwuj de6e4ad
update ui to only show progress for last step
leehuwuj 49a5a93
hide progress if the chat is finished
leehuwuj 3178d64
code cleanup
marcusschiesser abda5d7
allow upload multiple files and send empty message with file
leehuwuj 16d0bb0
enhance code
leehuwuj 64438d7
remove continue
leehuwuj a64df00
fix: use case
marcusschiesser 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-llama": patch | ||
--- | ||
|
||
Add form filling use case (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
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
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
54 changes: 54 additions & 0 deletions
54
templates/components/agents/python/form_filling/README-template.md
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,54 @@ | ||
This is a [LlamaIndex](https://www.llamaindex.ai/) multi-agents project using [Workflows](https://docs.llamaindex.ai/en/stable/understanding/workflows/). | ||
|
||
## Getting Started | ||
|
||
First, setup the environment with poetry: | ||
|
||
> **_Note:_** This step is not needed if you are using the dev-container. | ||
|
||
```shell | ||
poetry install | ||
``` | ||
|
||
Then check the parameters that have been pre-configured in the `.env` file in this directory. | ||
Make sure you have the `OPENAI_API_KEY` set. | ||
marcusschiesser marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Second, run the development server: | ||
|
||
```shell | ||
poetry run python main.py | ||
``` | ||
|
||
The example provides one streaming API endpoint `/api/chat`. | ||
You can test the endpoint with the following curl request: | ||
|
||
``` | ||
curl --location 'localhost:8000/api/chat' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{ "messages": [{ "role": "user", "content": "What can you do?" }] }' | ||
``` | ||
|
||
You can start editing the API by modifying `app/api/routers/chat.py` or `app/financial_report/workflow.py`. The API auto-updates as you save the files. | ||
|
||
Open [http://localhost:8000/docs](http://localhost:8000/docs) with your browser to see the Swagger UI of the API. | ||
|
||
The API allows CORS for all origins to simplify development. You can change this behavior by setting the `ENVIRONMENT` environment variable to `prod`: | ||
|
||
``` | ||
ENVIRONMENT=prod poetry run python main.py | ||
``` | ||
leehuwuj marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Use Case: Filling Financial CSV Template | ||
|
||
The project already includes the Apple and Tesla financial reports in the [data](./data) directory and a CSV template [sec_10k_template.csv](./sec_10k_template.csv). | ||
|
||
You can upload the files to the app and ask it to fill the missing cells in the CSV file. | ||
|
||
## Learn More | ||
|
||
To learn more about LlamaIndex, take a look at the following resources: | ||
|
||
- [LlamaIndex Documentation](https://docs.llamaindex.ai) - learn about LlamaIndex. | ||
- [Workflows Introduction](https://docs.llamaindex.ai/en/stable/understanding/workflows/) - learn about LlamaIndex workflows. | ||
|
||
You can check out [the LlamaIndex GitHub repository](https://github.com/run-llama/llama_index) - your feedback and contributions are welcome! |
Oops, something went wrong.
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.