0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

codex-actionでWEB検索を有効にする

Posted at

codex-args--enable web_search_requestと設定するとWEB検索を有効にできます。

name: Question
on:
  issues:
    types: [labeled]
jobs:
  answer:
    if: github.event.label.name == 'question'
    runs-on: ubuntu-latest
    permissions:
      issues: write
    outputs:
      final_message: ${{ steps.run_codex.outputs.final-message }}
    steps:
      - name: Run Codex
        id: run_codex
        uses: openai/codex-action@v1
        with:
          openai-api-key: ${{ secrets.OPENAI_API_KEY }}
          codex-args: |
            --enable web_search_request
          prompt: ${{ github.event.issue.body }}
      - name: Answer
        if: steps.run_codex.outputs.final-message != ''
        uses: actions/github-script@v8
        env:
          CODEX_FINAL_MESSAGE: ${{ steps.run_codex.outputs.final-message }}
        with:
          github-token: ${{ github.token }}
          script: |
            await github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              body: process.env.CODEX_FINAL_MESSAGE,
            });

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?