Skip to content

Commit c9b9ab3

Browse files
prefer OPENAI_KEY because other samples use it too
1 parent 3cdb0bb commit c9b9ab3

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

samples/langchain/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This sample is an endpoint that tells programming jokes and shows how to deploy
1313
## Deploying
1414

1515
1. Open the terminal and type `defang login`
16-
2. Set the environment variable `OPENAI_API_KEY` by typing `defang config set OPENAI_API_KEY`.
16+
2. Set the environment variable `OPENAI_KEY` by typing `defang config set OPENAI_KEY`.
1717
3. Type `defang compose up` in the CLI.
1818
4. Your app will be running within a few minutes.
1919

samples/langchain/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
)
1313

1414
def generate_text(prompt: str) -> str:
15-
api_key = os.getenv("OPENAI_API_KEY")
15+
api_key = os.getenv("OPENAI_KEY")
1616
model = OpenAI(api_key=api_key)
1717
response = model.invoke(prompt)
1818
return response

samples/langchain/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
context: ./app
55
dockerfile: Dockerfile
66
environment:
7-
- OPENAI_API_KEY
7+
- OPENAI_KEY
88
ports:
99
- target: 80
1010
published: 8080

0 commit comments

Comments
 (0)