Skip to content

Conversation

robertjdominguez
Copy link
Collaborator

Description

  • Fixed missing OpenAI API key configuration for TypeScript connector
  • Reorganized environment variables for better readability
  • Added proper CI/CD environment variable mapping

Previously, the TypeScript connector was configured but couldn't access the OpenAI API after rolling and redacting the old key:

const openai = new OpenAI({
  apiKey:
    process.env.OPENAI_API_KEY ||
    "[REMOVED]",
});

The environment variable OPENAI_API_KEY wasn't being passed through the connector configuration or CI pipeline, causing the embedding function to fall back to a placeholder value.

Now the OpenAI API key flows properly through all layers:

envMapping:
  OPENAI_API_KEY:
    fromEnv: APP_TS_OPENAI_API_KEY
environment:
  OPENAI_API_KEY: $APP_TS_OPENAI_API_KEY

This ensures the transformQueryIntoEmbedding function can actually generate embeddings instead of failing silently. The TypeScript connector is critical for semantic search functionality - without proper OpenAI access, document similarity matching would be broken.

Also cleaned up the environment variable ordering in the playground service for consistency, moving ANTHROPIC_KEY to the top since it's the primary LLM configuration.

Copy link

🚀 PromptQL Build Complete

Build Version: 09a4fdd451
Project: pql-docs
PromptQL Playground: Open Playground

Description: PR #39: PQL: Add env mapping for OpenAI API key

@robertjdominguez robertjdominguez merged commit 3b72fd1 into main Aug 11, 2025
1 check passed
@robertjdominguez robertjdominguez deleted the rob/add-pql-programs-connector branch August 11, 2025 15:55
Copy link

✅ PromptQL Build Applied

Build Version: 09a4fdd451
Status: Successfully applied to production
Applied at: 2025-08-11T15:55:31.527Z

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

Successfully merging this pull request may close these issues.

1 participant