diff --git a/.github/workflows/update-ai-assistant.yml b/.github/workflows/update-ai-assistant.yml new file mode 100644 index 0000000..9410c89 --- /dev/null +++ b/.github/workflows/update-ai-assistant.yml @@ -0,0 +1,41 @@ +name: Update AI assistant + +on: + push: + tags: + - '*' + branches: + - main + - ai-docs-follow-up + +env: + OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} + +jobs: + update-ai-assistant: + name: Reconfigure OpenAI assistant + runs-on: ubuntu-22.04 + steps: + - name: Set environment variables + run: | + if [[ $GITHUB_REF_NAME == refs/tags/* ]]; then + # tag push + echo "ASSISTANT_ENV=prod" >> $GITHUB_ENV + elif [[ $GITHUB_REF_NAME == refs/heads/* ]]; then + # branch push + echo "ASSISTANT_ENV=dev" >> $GITHUB_ENV + fi + + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node + uses: volta-cli/action@v4 + + - name: Reconfigure assistant + run: | + cd ./hack/assistant-setup + npm install + npm start diff --git a/hack/assistant-setup/index.ts b/hack/assistant-setup/index.ts index 052c69b..27aaa9b 100644 --- a/hack/assistant-setup/index.ts +++ b/hack/assistant-setup/index.ts @@ -3,8 +3,8 @@ import { setupFileSearch } from "./file-search"; import { setupTools } from "./tools"; import dedent from "dedent"; -const prodAssistantID = "asst_eMM9QaWLi6cajHE4PdG1yU53"; -const devAssistantID = "asst_ejVrAgjhhvCw6jGFYq5JyBqj"; +const prodAssistantID = "asst_EOOt8PiAy1boLPMTrFPdalHg"; // FIXME: pkosiec +const devAssistantID = "asst_EOOt8PiAy1boLPMTrFPdalHg"; // FIXME: pkosiec const model = "gpt-4-turbo"; const temperature = 0.1;