Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1214 from greenelab/rootstock-2024-01-14
Update rootstock on 2024-01-14
- Loading branch information
Showing
12 changed files
with
175 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -20,7 +20,7 @@ only_commits: | |
- ci/install.sh | ||
- content/ | ||
|
||
image: ubuntu | ||
image: ubuntu2204 | ||
services: | ||
- docker | ||
|
||
|
This file contains 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,75 @@ | ||
name: ai-revision | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
branch: | ||
description: 'Branch to revise' | ||
required: true | ||
type: string | ||
default: 'main' | ||
file_names: | ||
description: 'File names to revise' | ||
required: false | ||
type: string | ||
default: '' | ||
model: | ||
description: 'Language model' | ||
required: true | ||
type: string | ||
default: 'text-davinci-003' | ||
custom_prompt: | ||
description: 'Custom prompt' | ||
required: false | ||
type: string | ||
default: '' | ||
branch_name: | ||
description: 'Output branch' | ||
required: true | ||
type: string | ||
default: 'ai-revision-davinci' | ||
|
||
jobs: | ||
ai-revise: | ||
name: AI Revise | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
defaults: | ||
run: | ||
shell: bash --login {0} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Install environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install Manubot AI revision dependencies | ||
run: | | ||
# install using the same URL used for manubot in build/environment.yml | ||
manubot_line=$(grep "github.com/manubot/manubot" build/environment.yml) | ||
manubot_url=$(echo "$manubot_line" | awk -F"- " '{print $2}') | ||
pip install ${manubot_url}#egg=manubot[ai-rev] | ||
- name: Revise manuscript | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
AI_EDITOR_LANGUAGE_MODEL: ${{ inputs.model }} | ||
AI_EDITOR_FILENAMES_TO_REVISE: ${{ inputs.file_names }} | ||
AI_EDITOR_CUSTOM_PROMPT: ${{ inputs.custom_prompt }} | ||
# More variables can be specified to control the behavior of the model: | ||
# https://github.com/manubot/manubot-ai-editor/blob/main/libs/manubot_ai_editor/env_vars.py | ||
run: manubot ai-revision --content-directory content/ | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
commit-message: 'revise using AI model\n\nUsing the OpenAI model ${{ inputs.model }}' | ||
title: 'AI-based revision using ${{ inputs.model }}' | ||
author: OpenAI model ${{ inputs.model }} <support@openai.com> | ||
add-paths: | | ||
content/*.md | ||
branch: ${{ inputs.branch_name }} | ||
draft: true |
This file contains 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 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 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 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 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.