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

Add ability to run iterative prompts #5111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jkeiser
Copy link
Contributor

@jkeiser jkeiser commented Dec 12, 2024

This adds two distinct capabilities to the system:

  • The ability to include the current function text in a prompt with {FUNCTION_TEXT}. This allows ChatGPT to "fill in" a function you've already written rather than just generating a new one.
  • The ability to run a prompt iteratively: prompts are now an array of messages rather just one. After each prompt, the response from ChatGPT will be taken as the new function text, and fed back into the next prompt. This allows you to break up the problem for ChatGPT and/or cut files in pieces:
    1. Figure out the property names and hierarchy in this schema.
    2. Add validations to the schema.
    3. Add sockets.
    4. etc.

More sophisticated outputs from ChatGPT (other things than function text) may be useful here, and this should let us experiment with different docs at different times.

An example second prompt:

- ...
  <normal first prompt>
  ...
- model: gpt-4o-mini
  temperature: 0.0
  messages:
    - role: system
      content: >
        The following is a function in typescript, between three ^ characters. 

        ^^^
        {FUNCTION_TEXT}
        ^^^
        
        Please reproduce the entire function and add the comment "hi mom".

        Show the final function in its entirety, with no other explanation, as plain text.
        
        Do not wrap the code in markdown delimiters.

And there's "hi mom" at the bottom of the generated function!

@github-actions github-actions bot added the A-sdf Area: Primary backend API service [Rust] label Dec 12, 2024
@jkeiser jkeiser force-pushed the jkeiser/multiprompt branch from 0575041 to 6b43753 Compare December 13, 2024 05:32
@jkeiser jkeiser marked this pull request as ready for review December 13, 2024 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdf Area: Primary backend API service [Rust]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant