Skip to content

Commit

Permalink
feat: add OPENAI_BASE_URL envs (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai authored Sep 13, 2024
2 parents edf978e + fd475b3 commit 1da2b68
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 31 deletions.
1 change: 1 addition & 0 deletions .github/workflows/aws-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
GithubAppsClientId=${{ secrets.X_GITHUB_APPS_CLIENT_ID }} \
GithubAppsClientSecret=${{ secrets.X_GITHUB_APPS_CLIENT_SECRET }} \
OpenAIAPIKey=${{ secrets.OPENAI_API_KEY }} \
OpenAIBaseUrl=${{ vars.OPENAI_BASE_URL || 'https://api.openai.com/v1' }} \
GeminiAPIKey=${{ secrets.GEMINI_API_KEY }} \
SupabaseServiceKey=${{ secrets.SUPABASE_SERVICE_KEY }} \
SupabaseUrl=${{ secrets.SUPABASE_URL }} \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/aws-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
GithubAppsClientId=${{ secrets.X_GITHUB_APPS_CLIENT_ID }} \
GithubAppsClientSecret=${{ secrets.X_GITHUB_APPS_CLIENT_SECRET }} \
OpenAIAPIKey=${{ secrets.OPENAI_API_KEY }} \
OpenAIBaseUrl=${{ vars.OPENAI_BASE_URL || 'https://api.openai.com/v1' }} \
GeminiAPIKey=${{ secrets.GEMINI_API_KEY }} \
SupabaseServiceKey=${{ secrets.SUPABASE_SERVICE_KEY }} \
SupabaseUrl=${{ secrets.SUPABASE_URL }} \
Expand Down
5 changes: 3 additions & 2 deletions README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ The project requires environment variables to be set:
| `API_IDENTIFIER` | Required | Auth0 API Identifier | `https://petercat.us.auth0.com/api/v2/` |
| **LLM Related Environment Variables** |
| `OPENAI_API_KEY` | Required | OpenAI API key | `sk-xxxx` |
| `GEMINI_API_KEY` | Required | Gemini API key | `xxxx` |
| `TAVILY_API_KEY` | Required | Tavily API key | `tvly-xxxxx` |
| `OPENAI_BASE_URL` | Optional | Base URL for API requests. Only specify if using a proxy or service emulator. | `https://api.openai.com/v1`
| `GEMINI_API_KEY` | Optional | Gemini API key | `xxxx` |
| `TAVILY_API_KEY` | Optional | Tavily API key | `tvly-xxxxx` |
| **GitHub App Registration Environment Variables** |
| `X_GITHUB_APP_ID` | Optional | GitHub App ID | `123456` |
| `X_GITHUB_APPS_CLIENT_ID` | Optional | GitHub App Client ID | `Iv1.xxxxxxx` |
Expand Down
5 changes: 3 additions & 2 deletions README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@
| `API_IDENTIFIER` | 必須 | Auth0 API識別子 | `https://petercat.us.auth0.com/api/v2/` |
| **LLM関連環境変数** |
| `OPENAI_API_KEY` | 必須 | OpenAI APIキー | `sk-xxxx` |
| `GEMINI_API_KEY` | 必須 | Gemini APIキー | `xxxx` |
| `TAVILY_API_KEY` | 必須 | Tavily APIキー | `tvly-xxxxx` |
| `OPENAI_BASE_URL` | オプション | APIリクエストのためのベースURL。プロキシやサービスエミュレーターを使用する場合のみ指定します。 | `https://api.openai.com/v1` |
| `GEMINI_API_KEY` | オプション | Gemini APIキー | `xxxx` |
| `TAVILY_API_KEY` | オプション | Tavily APIキー | `tvly-xxxxx` |
| **GitHub App登録環境変数** |
| `X_GITHUB_APP_ID` | オプション | GitHub App ID | `123456` |
| `X_GITHUB_APPS_CLIENT_ID` | オプション | GitHub AppクライアントID | `Iv1.xxxxxxx` |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
| `API_IDENTIFIER` | 必选 | auth0 的 API Identifier | `https://petercat.us.auth0.com/api/v2/`
| **LLM相关的 env** |
| `OPENAI_API_KEY` | 必选 | OpenAI 的密钥 | `sk-xxxx`
| `OPENAI_BASE_URL` | 可选 | API 请求的基础 URL。仅在使用代理或服务模拟器时指定。| `https://api.openai.com/v1`
| `GEMINI_API_KEY` | 可选 | Gemini 的密钥 | `xxxx`
| `TAVILY_API_KEY` | 必选 | Tavily 的密钥 | `tvly-xxxxx`
| **注册为 Github App 的 env** |
Expand Down
60 changes: 33 additions & 27 deletions template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,108 +10,113 @@ Globals:
Parameters:
PetercatEnv:
Type: String
Description: Environment mark of PetercatEnv
Description: Environment marker for Petercat
Default: 1
GitHubAppID:
Type: Number
Description: Github App Id
Description: GitHub Application ID
Default: 1
GithubAppsClientId:
Type: String
Description: Github App Id
Description: GitHub Application Client ID
Default: 1
GitHubToken:
Type: String
Description: Github Token
Description: GitHub Token for authentication
Default: 1
WebUrl:
Type: String
Description: Web URL
Description: Web application URL
Default: 1
StaticUrl:
Type: String
Description: Static file url
Description: URL for static files
Default: 1
APIUrl:
Type: String
Description: API URL
Description: API endpoint URL
Default: 1
APIIdentifier:
Type: String
Description: APIIdentifier
Description: Identifier for the API
Default: 1
FastAPISecretKey:
Type: String
Description: FastAPISecretKey
Description: Secret key for FastAPI
Default: 1
GithubAppsClientSecret:
Type: String
Description: Github App Id
Description: GitHub Application Client Secret
Default: 1
OpenAIAPIKey:
Type: String
Description: Github App Id
Description: OpenAI API Key
Default: 1
OpenAIBaseUrl:
Type: String
Description: OpenAI Base URL
Default: 1
GeminiAPIKey:
Type: String
Description: Gemini API Key
Default: 1
SupabaseServiceKey:
Type: String
Description: Github App Id
Description: Supabase Service Key
Default: 1
SupabaseUrl:
Type: String
Description: Github App Id
Description: Supabase URL
Default: 1
TavilyAPIKey:
Type: String
Description: Github App Id
Description: Tavily API Key
Default: 1
SQSQueueName:
Type: String
Description: SQS Queue Name
Description: Name of the SQS queue
Default: 1
SQSQueueUrl:
Type: String
Description: SQS Queue Url
Description: URL of the SQS queue
Default: 1
Auth0Domain:
Auth0Domain:
Type: String
Description: Auth0 Domain
Default: 1
Auth0ClientId:
Type: String
Description: Auth0 ClientId
Description: Auth0 Client ID
Default: 1
Auth0ClientSecret:
Type: String
Description: Auth0 Clientt Secret
Description: Auth0 Client Secret
Default: 1
AWSGithubSecretName:
Type: String
Description: Github Secret Name Store in AWS
Description: Name of the GitHub secret stored in AWS Secrets Manager
Default: 1
AWSStaticSecretName:
Type: String
Description: Static Secret Name Store in AWS
Description: Name of the static secret stored in AWS Secrets Manager
Default: 1
AWSLLMTokenSecretName:
AWSLLMTokenSecretName:
Type: String
Description: AWS Secret Name Store in AWS
Description: Name of the LLM token secret stored in AWS Secrets Manager
Default: 1
AWSLLMTokenPublicName:
Type: String
Description: AWS Public Name Store in AWS
Description: Name of the LLM public token stored in AWS Secrets Manager
Default: 1
AWSStaticKeyPairId:
AWSStaticKeyPairId:
Type: String
Description: Static Key Pair Id
Description: Key Pair ID for static resources
Default: 1
S3TempBucketName:
Type: String
Description: S3 Bucket Name
Description: Name of the temporary S3 bucket
Default: 1

Resources:
FastAPIFunction:
Type: AWS::Serverless::Function
Expand All @@ -137,6 +142,7 @@ Resources:
API_IDENTIFIER: !Ref APIIdentifier
FASTAPI_SECRET_KEY: !Ref FastAPISecretKey
OPENAI_API_KEY: !Ref OpenAIAPIKey
OPENAI_BASE_URL: !Ref OpenAIBaseUrl
GEMINI_API_KEY: !Ref GeminiAPIKey
SUPABASE_SERVICE_KEY: !Ref SupabaseServiceKey
SUPABASE_URL: !Ref SupabaseUrl
Expand Down

0 comments on commit 1da2b68

Please sign in to comment.