Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions features/create_agent/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Provider API key(s) for the provider your agent config uses
OPENAI_API_KEY=

# Optional - defaults to "sample-agent"
LAUNCHDARKLY_AGENT_KEY=
10 changes: 4 additions & 6 deletions features/create_agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ This example demonstrates how to use LaunchDarkly's `create_agent` method, which

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

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

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

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AGENT_CONFIG_KEY=sample-agent-config
OPENAI_API_KEY=your-openai-api-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
2 changes: 1 addition & 1 deletion features/create_agent/create_agent_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')

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


def get_weather(city: str) -> str:
Expand Down
8 changes: 8 additions & 0 deletions features/create_agent_graph/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Provider API key(s) for the provider(s) your agent graph uses
OPENAI_API_KEY=

# Optional - defaults to "sample-agent-graph"
LAUNCHDARKLY_AGENT_GRAPH_KEY=
8 changes: 3 additions & 5 deletions features/create_agent_graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ This example demonstrates how to use LaunchDarkly's `create_agent_graph` method,
- [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.
- [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`.

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

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AGENT_GRAPH_KEY=sample-agent-graph
OPENAI_API_KEY=your-openai-api-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
8 changes: 8 additions & 0 deletions features/create_judge/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Provider API key(s) for the provider your judge config uses
OPENAI_API_KEY=

# Optional - defaults to "sample-judge"
LAUNCHDARKLY_JUDGE_KEY=
10 changes: 4 additions & 6 deletions features/create_judge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ This example demonstrates how to use LaunchDarkly's `create_judge` method to eva

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

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

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

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AI_JUDGE_KEY=sample-ai-judge
OPENAI_API_KEY=your-openai-api-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
2 changes: 1 addition & 1 deletion features/create_judge/create_judge_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')

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


async def async_main():
Expand Down
8 changes: 8 additions & 0 deletions features/create_model/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Provider API key(s) for the provider your AI config uses
OPENAI_API_KEY=

# Optional - defaults to "sample-completion"
LAUNCHDARKLY_COMPLETION_KEY=
10 changes: 4 additions & 6 deletions features/create_model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ This example demonstrates how to use LaunchDarkly's `create_model` method, which

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

- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a model and system message. Default key: `sample-completion-config`.
- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a model and system message. Default key: `sample-completion`.

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

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AI_CONFIG_KEY=sample-completion-config
OPENAI_API_KEY=your-openai-api-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
2 changes: 1 addition & 1 deletion features/create_model/create_model_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')

# Set config_key to the AI Config key you want to evaluate.
ai_config_key = os.getenv('LAUNCHDARKLY_AI_CONFIG_KEY', 'sample-completion-config')
ai_config_key = os.getenv('LAUNCHDARKLY_COMPLETION_KEY', 'sample-completion')


async def async_main():
Expand Down
12 changes: 12 additions & 0 deletions getting_started/bedrock/converse/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Your AWS credentials for Bedrock access
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Optional - defaults to "us-east-1"
AWS_DEFAULT_REGION=

# Optional - defaults to "sample-completion"
LAUNCHDARKLY_COMPLETION_KEY=
21 changes: 6 additions & 15 deletions getting_started/bedrock/converse/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,17 @@ This example demonstrates how to use LaunchDarkly's AI Config with the AWS Bedro

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

- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a Bedrock model and a system message. Default key: `sample-completion-config`.
- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a Bedrock model and a system message. Default key: `sample-completion`.

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

```bash
cp .env.example .env
```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AI_CONFIG_KEY=sample-completion-config
```

> `LAUNCHDARKLY_AI_CONFIG_KEY` defaults to `sample-completion-config` if not set.

1. Ensure your AWS credentials can be [auto-detected by the `boto3` library](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html). You can set them in your `.env` file:

```
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
AWS_DEFAULT_REGION=us-east-1
```
`LAUNCHDARKLY_COMPLETION_KEY` defaults to `sample-completion` if not set.

Other options include role providers or shared credential files.
Ensure your AWS credentials can be [auto-detected by the `boto3` library](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html). Setting them in `.env` is one option; role providers or shared credential files are also supported.

1. Install the required dependencies:

Expand Down
4 changes: 2 additions & 2 deletions getting_started/bedrock/converse/bedrock_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def get_bedrock_metrics(response):
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')

# Set config_key to the AI Config key you want to evaluate.
ai_config_key = os.getenv('LAUNCHDARKLY_AI_CONFIG_KEY', 'sample-completion-config')
ai_config_key = os.getenv('LAUNCHDARKLY_COMPLETION_KEY', 'sample-completion')

def main():
if not sdk_key:
print("*** Please set the LAUNCHDARKLY_SDK_KEY env first")
exit()
if not ai_config_key:
print("*** Please set the LAUNCHDARKLY_AI_CONFIG_KEY env first")
print("*** Please set the LAUNCHDARKLY_COMPLETION_KEY env first")
exit()

ldclient.set_config(Config(sdk_key, plugins=[
Expand Down
8 changes: 8 additions & 0 deletions getting_started/gemini/generate_content/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Your Google API key
GOOGLE_API_KEY=

# Optional - defaults to "sample-completion"
LAUNCHDARKLY_COMPLETION_KEY=
10 changes: 4 additions & 6 deletions getting_started/gemini/generate_content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ This example demonstrates how to use LaunchDarkly's AI Config with the Google Ge

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

- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a Gemini model (e.g. `gemini-2.0-flash`) and a system message. Default key: `sample-completion-config`.
- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a Gemini model (e.g. `gemini-2.0-flash`) and a system message. Default key: `sample-completion`.

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

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AI_CONFIG_KEY=sample-completion-config
GOOGLE_API_KEY=your-google-api-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
4 changes: 2 additions & 2 deletions getting_started/gemini/generate_content/gemini_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')

# Set config_key to the AI Config key you want to evaluate.
ai_config_key = os.getenv('LAUNCHDARKLY_AI_CONFIG_KEY', 'sample-completion-config')
ai_config_key = os.getenv('LAUNCHDARKLY_COMPLETION_KEY', 'sample-completion')

# Set Google API key
google_api_key = os.getenv('GOOGLE_API_KEY')
Expand Down Expand Up @@ -93,7 +93,7 @@ def main():
print("*** Please set the LAUNCHDARKLY_SDK_KEY env first")
exit()
if not ai_config_key:
print("*** Please set the LAUNCHDARKLY_AI_CONFIG_KEY env first")
print("*** Please set the LAUNCHDARKLY_COMPLETION_KEY env first")
exit()
if not google_api_key:
print("*** Please set the GOOGLE_API_KEY env first")
Expand Down
11 changes: 11 additions & 0 deletions getting_started/langchain/invoke/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Provider API keys - fill in the ones for the provider(s) your AI config uses
OPENAI_API_KEY=
GOOGLE_API_KEY=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Optional - defaults to "sample-completion"
LAUNCHDARKLY_COMPLETION_KEY=
18 changes: 4 additions & 14 deletions getting_started/langchain/invoke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,12 @@ This example demonstrates how to use LaunchDarkly's AI Config with LangChain, su

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

- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a model and a system message. Default key: `sample-completion-config`.
- [Create an AI Config](https://launchdarkly.com/docs/home/ai-configs/create) with a model and a system message. Default key: `sample-completion`.

1. Create a `.env` file in this directory with the following variables:
1. Copy `.env.example` to `.env` and fill in your keys (only the provider keys for providers you actually use are required):

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AI_CONFIG_KEY=sample-completion-config
```

Add the API keys for the providers you want to use:

```
OPENAI_API_KEY=your-openai-api-key
GOOGLE_API_KEY=your-google-api-key
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
4 changes: 2 additions & 2 deletions getting_started/langchain/invoke/langchain_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')

# Set config_key to the AI Config key you want to evaluate.
ai_config_key = os.getenv('LAUNCHDARKLY_AI_CONFIG_KEY', 'sample-completion-config')
ai_config_key = os.getenv('LAUNCHDARKLY_COMPLETION_KEY', 'sample-completion')

def map_provider_to_langchain(provider_name):
"""Map LaunchDarkly provider names to LangChain provider names."""
Expand All @@ -35,7 +35,7 @@ async def async_main():
print("*** Please set the LAUNCHDARKLY_SDK_KEY env first")
exit()
if not ai_config_key:
print("*** Please set the LAUNCHDARKLY_AI_CONFIG_KEY env first")
print("*** Please set the LAUNCHDARKLY_COMPLETION_KEY env first")
exit()

ldclient.set_config(Config(sdk_key, plugins=[
Expand Down
11 changes: 11 additions & 0 deletions getting_started/langgraph/react_agent/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Provider API keys - fill in the ones for the provider(s) your agent config uses
OPENAI_API_KEY=
GOOGLE_API_KEY=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Optional - defaults to "sample-agent"
LAUNCHDARKLY_AGENT_KEY=
18 changes: 4 additions & 14 deletions getting_started/langgraph/react_agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,12 @@ This example demonstrates how to use LaunchDarkly's AI Config with LangGraph to

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

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

1. Create a `.env` file in this directory with the following variables:
1. Copy `.env.example` to `.env` and fill in your keys (only the provider keys for providers you actually use are required):

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_AGENT_CONFIG_KEY=sample-agent-config
```

Add the API keys for the providers you want to use:

```
OPENAI_API_KEY=your-openai-api-key
GOOGLE_API_KEY=your-google-api-key
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
sdk_key = os.getenv('LAUNCHDARKLY_SDK_KEY')

# Set config key for the agent
agent_config_key = os.getenv('LAUNCHDARKLY_AGENT_CONFIG_KEY', 'sample-agent-config')
agent_config_key = os.getenv('LAUNCHDARKLY_AGENT_KEY', 'sample-agent')

def map_provider_to_langchain(provider_name):
"""Map LaunchDarkly provider names to LangChain provider names."""
Expand Down
14 changes: 14 additions & 0 deletions getting_started/langgraph/state_graph/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Your LaunchDarkly server-side SDK key
LAUNCHDARKLY_SDK_KEY=

# Provider API keys - fill in the ones for the provider(s) your agent configs use
OPENAI_API_KEY=
GOOGLE_API_KEY=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=

# Optional - defaults to "code-review-analyzer"
LAUNCHDARKLY_ANALYZER_KEY=

# Optional - defaults to "code-review-documentation"
LAUNCHDARKLY_DOCUMENTATION_KEY=
17 changes: 3 additions & 14 deletions getting_started/langgraph/state_graph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,10 @@ This example demonstrates how to use LaunchDarkly's AI Config with LangGraph to
- [Create an AI Agent Config](https://launchdarkly.com/docs/home/ai-configs/agents) for code analysis. Default key: `code-review-analyzer`.
- [Create an AI Agent Config](https://launchdarkly.com/docs/home/ai-configs/agents) for documentation generation. Default key: `code-review-documentation`.

1. Create a `.env` file in this directory with the following variables:
1. Copy `.env.example` to `.env` and fill in your keys (only the provider keys for providers you actually use are required):

```
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
LAUNCHDARKLY_ANALYZER_CONFIG_KEY=code-review-analyzer
LAUNCHDARKLY_DOCUMENTATION_CONFIG_KEY=code-review-documentation
```

Add the API keys for the providers you want to use:

```
OPENAI_API_KEY=your-openai-api-key
GOOGLE_API_KEY=your-google-api-key
AWS_ACCESS_KEY_ID=your-access-key-id
AWS_SECRET_ACCESS_KEY=your-secret-access-key
```bash
cp .env.example .env
```

1. Install the required dependencies:
Expand Down
Loading
Loading