Skip to content
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

Avoiding Unnecessary Python Code generation steps #463

Closed
AmaliMatharaarachchi opened this issue Feb 8, 2025 · 2 comments
Closed

Avoiding Unnecessary Python Code generation steps #463

AmaliMatharaarachchi opened this issue Feb 8, 2025 · 2 comments

Comments

@AmaliMatharaarachchi
Copy link

Is your feature request related to a problem? Please describe.
I'm trying to plot data extracted from a PDF. Currently, Taskweaver’s default behavior follows this sequence.

  • Extracts raw text from the PDF using Python script by code interpreter.
  • Next step is generating a Python script with regex patterns to extract structured data from the text by code interpreter. (This step is inefficient because LLMs can directly extract relevant data without writing Python code.)
  • Creates another Python script to process the extracted data and generate the required plots.

The issue is with Step 2—generating a Python script for regex-based extraction. This step often leads to iterations where the model struggles with regex patterns or refining the code, making the process slower and unnecessarily complex and exceeding internal chat rounds.

How can I modify Taskweaver’s default behavior to skip Step 2 and extract structured data directly using the planner/LLM before sending it to the code interpreter?

Would appreciate guidance on configuring this behavior!

Describe the solution you'd like
Instead of generating a Python script for regex-based extraction, I want the LLM to:

  • Extract data directly from the text (without generating regex-based extraction code using code interpreter).
  • Not engaging code interpreter for simple llm abled tasks.

Describe alternatives you've considered
Tried changing code-interpreter role description
Add examples in prompt_planner

Additional context
Add any other context or screenshots about the feature request here.

@liqul
Copy link
Contributor

liqul commented Feb 8, 2025

Could you try the idea described in this blog? If not work, please share a minium example to us to reproduce the scenario.

@AmaliMatharaarachchi
Copy link
Author

Hi @liqul,

Thank you for the blog post. It was helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants