Skip to content

Commit 9f453e1

Browse files
authored
chore: Align example config keys and env vars with new naming (#29)
1 parent b97c863 commit 9f453e1

30 files changed

Lines changed: 158 additions & 106 deletions

features/create_agent/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Your LaunchDarkly server-side SDK key
2+
LAUNCHDARKLY_SDK_KEY=
3+
4+
# Provider API key(s) for the provider your agent config uses
5+
OPENAI_API_KEY=
6+
7+
# Override to use a different AI Config
8+
LAUNCHDARKLY_AGENT_KEY=sample-agent

features/create_agent/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ This example demonstrates how to use LaunchDarkly's `create_agent` method, which
1313

1414
1. Create the following config in your LaunchDarkly project. You can use a different key by setting the environment variable in your `.env`.
1515

16-
- [Create an AI Agent Config](https://launchdarkly.com/docs/home/ai-configs/agents) with a model and agent instructions. Default key: `sample-agent-config`.
16+
- [Create an AI Agent Config](https://launchdarkly.com/docs/home/ai-configs/agents) with a model and agent instructions. Default key: `sample-agent`.
1717

18-
1. Create a `.env` file in this directory with the following variables:
18+
1. Copy `.env.example` to `.env` and fill in your keys:
1919

20-
```
21-
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
22-
LAUNCHDARKLY_AGENT_CONFIG_KEY=sample-agent-config
23-
OPENAI_API_KEY=your-openai-api-key
20+
```bash
21+
cp .env.example .env
2422
```
2523

2624
1. Install the required dependencies:

features/create_agent/create_agent_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')
1818

1919
# Set agent_config_key to the AI Agent Config key you want to evaluate.
20-
agent_config_key = os.getenv('LAUNCHDARKLY_AGENT_CONFIG_KEY', 'sample-agent-config')
20+
agent_config_key = os.getenv('LAUNCHDARKLY_AGENT_KEY', 'sample-agent')
2121

2222

2323
def get_weather(city: str) -> str:
@@ -110,6 +110,7 @@ async def async_main():
110110
print("\nNo judge evaluations were performed.")
111111

112112
except Exception as err:
113+
# In production, sanitize before logging — provider errors may include credentials.
113114
print("Error:", err)
114115
finally:
115116
# Flush pending events and close the client.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Your LaunchDarkly server-side SDK key
2+
LAUNCHDARKLY_SDK_KEY=
3+
4+
# Provider API key(s) for the provider(s) your agent graph uses
5+
OPENAI_API_KEY=
6+
7+
# Override to use a different AI Config
8+
LAUNCHDARKLY_AGENT_GRAPH_KEY=sample-agent-graph

features/create_agent_graph/README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ This example demonstrates how to use LaunchDarkly's `create_agent_graph` method,
1616
- [Create AI Agent Configs](https://launchdarkly.com/docs/home/ai-configs/agents) for each node in your graph. Configure each with a model and agent instructions. Add tools (e.g. `search_flights`, `search_hotels`, `get_weather`) to the agents that need them.
1717
- [Create an Agent Graph](https://launchdarkly.com/docs/home/ai-configs/create) that connects your agent configs as nodes with edges defining the workflow. Default key: `sample-agent-graph`.
1818

19-
1. Create a `.env` file in this directory with the following variables:
19+
1. Copy `.env.example` to `.env` and fill in your keys:
2020

21-
```
22-
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
23-
LAUNCHDARKLY_AGENT_GRAPH_KEY=sample-agent-graph
24-
OPENAI_API_KEY=your-openai-api-key
21+
```bash
22+
cp .env.example .env
2523
```
2624

2725
1. Install the required dependencies:

features/create_agent_graph/create_agent_graph_example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ async def async_main():
128128
print(f" reasoning: {eval_result.reasoning}")
129129

130130
except Exception as err:
131+
# In production, sanitize before logging — provider errors may include credentials.
131132
print("Error:", err)
132133
finally:
133134
# Flush pending events and close the client.

features/create_judge/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Your LaunchDarkly server-side SDK key
2+
LAUNCHDARKLY_SDK_KEY=
3+
4+
# Provider API key(s) for the provider your judge config uses
5+
OPENAI_API_KEY=
6+
7+
# Override to use a different AI Config
8+
LAUNCHDARKLY_JUDGE_KEY=sample-judge

features/create_judge/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,12 @@ This example demonstrates how to use LaunchDarkly's `create_judge` method to eva
1313

1414
1. Create the following config in your LaunchDarkly project. You can use a different key by setting the environment variable in your `.env`.
1515

16-
- [Create a Judge Config](https://launchdarkly.com/docs/home/ai-configs/judges) for evaluation. Default key: `sample-ai-judge`.
16+
- [Create a Judge Config](https://launchdarkly.com/docs/home/ai-configs/judges) for evaluation. Default key: `sample-judge`.
1717

18-
1. Create a `.env` file in this directory with the following variables:
18+
1. Copy `.env.example` to `.env` and fill in your keys:
1919

20-
```
21-
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
22-
LAUNCHDARKLY_AI_JUDGE_KEY=sample-ai-judge
23-
OPENAI_API_KEY=your-openai-api-key
20+
```bash
21+
cp .env.example .env
2422
```
2523

2624
1. Install the required dependencies:

features/create_judge/create_judge_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')
1818

1919
# Set judge_key to the Judge key you want to use.
20-
judge_key = os.getenv('LAUNCHDARKLY_AI_JUDGE_KEY', 'sample-ai-judge')
20+
judge_key = os.getenv('LAUNCHDARKLY_JUDGE_KEY', 'sample-judge')
2121

2222

2323
async def async_main():
@@ -95,6 +95,7 @@ async def async_main():
9595

9696
print("\nDone!")
9797
except Exception as err:
98+
# In production, sanitize before logging — provider errors may include credentials.
9899
print("Error:", err)
99100
finally:
100101
# Flush pending events and close the client.

features/create_model/.env.example

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Your LaunchDarkly server-side SDK key
2+
LAUNCHDARKLY_SDK_KEY=
3+
4+
# Provider API key(s) for the provider your AI config uses
5+
OPENAI_API_KEY=
6+
7+
# Override to use a different AI Config
8+
LAUNCHDARKLY_COMPLETION_KEY=sample-completion

0 commit comments

Comments
 (0)