Skip to content

Commit 71b2c5a

Browse files
authored
fix(ask-baml): use correct env var names, hopefully (#2266)
Docs assistant is 405'ing right now <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Fix environment variable names in GitHub Actions and Pinecone API to ensure correct environment settings for production and development. > > - **Environment Variables**: > - In `publish-docs.yml`, change `TARGET_ENV` from `prod` to `production` and `NODE_ENV` to `PINECONE_ENV` with values `prod`/`dev`. > - **Pinecone API**: > - In `pinecone-api.ts`, update `PINECONE_INDEX_NAME` to use `PINECONE_ENV` for determining index name (`ask-baml-prod` or `ask-baml-dev`). > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for fff9a6c. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent aacc74b commit 71b2c5a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/publish-docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
run: |
101101
pnpm baml-cli generate
102102
if [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/canary" ]; then
103-
echo TARGET_ENV=prod >>$GITHUB_ENV
103+
echo TARGET_ENV=production >>$GITHUB_ENV
104104
else
105105
echo TARGET_ENV=preview >>$GITHUB_ENV
106106
fi
@@ -151,9 +151,9 @@ jobs:
151151
- name: Set environment variables
152152
run: |
153153
if [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/canary" ]; then
154-
echo NODE_ENV=production >>$GITHUB_ENV
154+
echo PINECONE_ENV=prod >>$GITHUB_ENV
155155
else
156-
echo NODE_ENV=development >>$GITHUB_ENV
156+
echo PINECONE_ENV=dev >>$GITHUB_ENV
157157
fi
158158
159159
- name: Update pinecone

typescript/apps/sage-backend/lib/pinecone-api.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import { type SitemapEntry, SitemapGenerator } from './sitemap';
1010

1111
const EMBEDDING_MODEL = 'text-embedding-3-large';
1212
const PINECONE_INDEX_NAME =
13-
process.env.NODE_ENV === 'production' ? 'ask-baml-prod' : 'ask-baml-dev';
13+
process.env.PINECONE_ENV === 'prod' || process.env.PINECONE_ENV === 'production'
14+
? 'ask-baml-prod'
15+
: 'ask-baml-dev';
1416
console.log('Using pinecone index:', PINECONE_INDEX_NAME);
1517

1618
const openaiClient = new OpenAI({

0 commit comments

Comments
 (0)