AutoResearch / autodoc

MIT License
0 stars 1 forks source link

feat: Support one-shot prompts #26

Closed carlosgjs closed 7 months ago

carlosgjs commented 8 months ago

This PR refactors the prompt management to add support for one-shot prediction. Specifically:

Test outputs from the generate.ipynb notebook:

PromptIds.AUTORA_VARS_ZEROSHOT
******* Output 0 ******** 
The dependent variable "y" is a real-valued variable, while the independent variable "x" is a continuous variable with a range of [0, 2π] and 30 allowed values. 
*************

PromptIds.AUTORA_VARS_ONESHOT
******* Output 0 ******** 
The problem is defined by one independent variable $x \in [0, 2 \pi]$ and one dependent variable $y$. 
*************
codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (61d2480) 96.57% compared to head (1fdb074) 97.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #26 +/- ## ========================================== + Coverage 96.57% 97.00% +0.43% ========================================== Files 3 3 Lines 146 167 +21 ========================================== + Hits 141 162 +21 Misses 5 5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lsetiawan commented 7 months ago

The changes I think are good and I don't have much comment on that. I do have some thoughts on the PromptBuilder class. Is this serving almost like a template engine thing? Seems like you're trying to pack together some sort of prompt text. My thought is maybe it's worth to create some sort of prompt template say with tools like jinja so that it's easier to see what is actually getting build. At this moment, without actually running the code, I have a hard time understanding what is actually happening... Idk, what do you think?

carlosgjs commented 7 months ago

The changes I think are good and I don't have much comment on that. I do have some thoughts on the PromptBuilder class. Is this serving almost like a template engine thing? Seems like you're trying to pack together some sort of prompt text. My thought is maybe it's worth to create some sort of prompt template say with tools like jinja so that it's easier to see what is actually getting build. At this moment, without actually running the code, I have a hard time understanding what is actually happening... Idk, what do you think?

Didn't know about jinja and it looks pretty powerful. But perhaps its overkill for this scenario? I'm hesitant to add a package dependency for a relatively simple string building.

lsetiawan commented 7 months ago

Didn't know about jinja and it looks pretty powerful. But perhaps its overkill for this scenario? I'm hesitant to add a package dependency for a relatively simple string building.

Okay, I wasn't sure how complex these prompts may be. 😄 I do like what you did in your last commit to at least make the code more readable.