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

ai-revision does nothing when specifying a file #17

Closed
SilasK opened this issue May 31, 2023 · 8 comments
Closed

ai-revision does nothing when specifying a file #17

SilasK opened this issue May 31, 2023 · 8 comments

Comments

@SilasK
Copy link

SilasK commented May 31, 2023

I run the ai-revision.
Without specifying any file it only updates the introduction.

If I specify a file it does aparently nothing and the pull request fails
https://github.com/SilasK/Research_Proposal/actions/runs/5134823028/jobs/9239373226

@agitter
Copy link
Member

agitter commented May 31, 2023

Is the linked repository private? I get a 404 error. @miltondp or I may be able to take a look at the log to see what is happening.

@dhimmel dhimmel transferred this issue from manubot/rootstock May 31, 2023
@miltondp
Copy link
Collaborator

Hi @SilasK, thank you for your interest. The tool uses section-specific prompts to revise the text, and it will try to infer the section from the file names. If this fails, which seems to be your case, you need to indicate which section each file belongs to. I've added this documentation in this PR, and it would be great if you could go through it and let us know if it is clear and help you solve the problem.

@SilasK
Copy link
Author

SilasK commented May 31, 2023

Thank you for your reply.

Sorry, yes it's private.

Nothing special in the log:

Run manubot ai-revision --content-directory content/
  manubot ai-revision --content-directory content/
  shell: /usr/bin/bash --login {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.11.3/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.11.3/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.3/x64
    Python[2](https://github.com/SilasK/Research_Proposal/actions/runs/5134892888/jobs/9239537171#step:5:2)_ROOT_DIR: /opt/hostedtoolcache/Python/[3](https://github.com/SilasK/Research_Proposal/actions/runs/5134892888/jobs/9239537171#step:5:3).11.3/x6[4](https://github.com/SilasK/Research_Proposal/actions/runs/5134892888/jobs/9239537171#step:5:4)
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.11.3/x[6](https://github.com/SilasK/Research_Proposal/actions/runs/5134892888/jobs/9239537171#step:5:6)4
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.[11](https://github.com/SilasK/Research_Proposal/actions/runs/5134892888/jobs/9239537171#step:5:11).3/x64/lib
    OPENAI_API_KEY: ***
    AI_EDITOR_LANGUAGE_MODEL: text-davinci-003
    AI_EDITOR_FILENAMES_TO_REVISE: 03.aim_subspecies_quant.md
Using language model from environment variable 'AI_EDITOR_LANGUAGE_MODEL'
Language model:  text-davinci-003
File names to revise: {'03.aim_subspecies_quant.md'}

raw_log_ai_revision.txt

@SilasK
Copy link
Author

SilasK commented May 31, 2023

Ok, I will add the file mapping.

My manuscript is actualy more a grant proposal. than an article.
I asume in the mapping I can give arbitrary description, can I?

Is there a simple way to modify the query context sent to the AI model?

@miltondp
Copy link
Collaborator

Yes, you can use whatever you want as the section name. In that case, it will default to a general prompt, as you can see here. Keep in mind also that that general prompt mentions "... of an academic paper...", which might or might not affect the text revision of a grant proposal.

Regarding custom prompts, I agree that it will be better in your case, and we will be working on that soon. However, there is a work-in-progress feature that you can use: add this environment variable in the .github/workflows/ai-revision.yaml file (in the "Revise manuscript" step) to provide whatever prompt you want:

AI_EDITOR_CUSTOM_PROMPT: "Proofread the following paragraph"

Again, if you give it a try, please give us feedback on whether it worked as expected or not.

@SilasK
Copy link
Author

SilasK commented Jun 7, 2023

I made it work for both the file specification and the custom prompt.
I don't know if it is possible to use the file specification in the custom prompt as in the original one?

@miltondp
Copy link
Collaborator

miltondp commented Jun 7, 2023

Thanks for the feedback!

You can't use a custom prompt per file if that's what you mean. But sounds like a good use case. We'll be working on these use cases soon, so if you can provide a more detailed specification of what you would like to have, that would be really helpful.

@miltondp
Copy link
Collaborator

miltondp commented Jun 7, 2023

I'm closing this as completed, but feel free to reopen if needed.

@miltondp miltondp closed this as completed Jun 7, 2023
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

3 participants