File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ def validate_log_level(cls, v: str) -> str:
4646 default = "claude-api-key" ,
4747 description = "Name of the Prefect secret block containing Claude API key" ,
4848 )
49+ openai_api_key_secret_name : str = Field (
50+ default = "openai-api-key" ,
51+ description = "Name of the Prefect secret block containing OpenAI API key" ,
52+ )
4953
5054 vector_store_type : Literal ["turbopuffer" ] = Field (
5155 default = "turbopuffer" , description = "Type of vector store to use"
Original file line number Diff line number Diff line change 1+ import os
2+
3+ from prefect .blocks .system import Secret
4+
15if __name__ == "__main__" :
26 import uvicorn
37 from settings import settings
48
9+ if not (openai_api_key := os .getenv ("OPENAI_API_KEY" )):
10+ os .environ ["OPENAI_API_KEY" ] = Secret .load (
11+ settings .openai_api_key_secret_name , _sync = True
12+ ).get ()
13+
514 uvicorn .run (
615 "api:app" ,
716 host = settings .host ,
You can’t perform that action at this time.
0 commit comments