Skip to content

Commit 675765f

Browse files
tracisiebelclaude
andcommitted
chore: make each example self-contained with its own pyproject.toml
- Add per-example pyproject.toml with only the dependencies that example needs; no extras flags required, just `poetry install` - Remove __init__.py files (no longer needed as Python packages) - Simplify root pyproject.toml, removing scripts/extras/packages - Update READMEs to reflect local .env and plain `poetry install` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6b331e7 commit 675765f

25 files changed

Lines changed: 208 additions & 52 deletions

examples/bedrock/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This example demonstrates how to use LaunchDarkly's AI Config with the AWS Bedro
1111

1212
## Setup
1313

14-
1. Create a `.env` file in the repository root with the following variables:
14+
1. Create a `.env` file in this directory with the following variables:
1515

1616
```
1717
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
@@ -33,7 +33,7 @@ This example demonstrates how to use LaunchDarkly's AI Config with the AWS Bedro
3333
3. Install the required dependencies:
3434

3535
```bash
36-
poetry install -E bedrock
36+
poetry install
3737
```
3838

3939
## Run

examples/bedrock/__init__.py

Whitespace-only changes.

examples/bedrock/pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tool.poetry]
2+
name = "hello-python-ai-bedrock"
3+
version = "0.1.0"
4+
description = "Hello LaunchDarkly for Python AI - Bedrock"
5+
authors = ["LaunchDarkly <dev@launchdarkly.com>"]
6+
license = "Apache-2.0"
7+
readme = "README.md"
8+
packages = [{include = "bedrock_example.py"}]
9+
10+
[tool.poetry.scripts]
11+
bedrock-example = "bedrock_example:main"
12+
13+
[tool.poetry.dependencies]
14+
python = "^3.10"
15+
python-dotenv = ">=1.0.0"
16+
launchdarkly-server-sdk-ai = "^0.17.0"
17+
boto3 = ">=0.2.0"
18+
19+
[build-system]
20+
requires = ["poetry-core"]
21+
build-backend = "poetry.core.masonry.api"

examples/chat_observability/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ View your data in the LaunchDarkly dashboard under **Observability** tabs.
1818

1919
## Setup
2020

21-
1. Create a `.env` file in the repository root with the following variables:
21+
1. Create a `.env` file in this directory with the following variables:
2222

2323
```
2424
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
@@ -38,7 +38,7 @@ View your data in the LaunchDarkly dashboard under **Observability** tabs.
3838
2. Install the required dependencies:
3939

4040
```bash
41-
poetry install -E observability
41+
poetry install
4242
```
4343

4444
## Run

examples/chat_observability/__init__.py

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tool.poetry]
2+
name = "hello-python-ai-chat-observability"
3+
version = "0.1.0"
4+
description = "Hello LaunchDarkly for Python AI - Chat with Observability"
5+
authors = ["LaunchDarkly <dev@launchdarkly.com>"]
6+
license = "Apache-2.0"
7+
readme = "README.md"
8+
packages = [{include = "chat_observability_example.py"}]
9+
10+
[tool.poetry.scripts]
11+
chat-observability-example = "chat_observability_example:main"
12+
13+
[tool.poetry.dependencies]
14+
python = "^3.10"
15+
python-dotenv = ">=1.0.0"
16+
launchdarkly-server-sdk-ai = "^0.17.0"
17+
launchdarkly-observability = ">=0.1.0"
18+
openai = ">=0.2.0"
19+
20+
[build-system]
21+
requires = ["poetry-core"]
22+
build-backend = "poetry.core.masonry.api"

examples/gemini/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This example demonstrates how to use LaunchDarkly's AI Config with the Google Ge
1111

1212
## Setup
1313

14-
1. Create a `.env` file in the repository root with the following variables:
14+
1. Create a `.env` file in this directory with the following variables:
1515

1616
```
1717
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
@@ -24,7 +24,7 @@ This example demonstrates how to use LaunchDarkly's AI Config with the Google Ge
2424
2. Install the required dependencies:
2525

2626
```bash
27-
poetry install -E gemini
27+
poetry install
2828
```
2929

3030
## Run

examples/gemini/__init__.py

Whitespace-only changes.

examples/gemini/pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tool.poetry]
2+
name = "hello-python-ai-gemini"
3+
version = "0.1.0"
4+
description = "Hello LaunchDarkly for Python AI - Gemini"
5+
authors = ["LaunchDarkly <dev@launchdarkly.com>"]
6+
license = "Apache-2.0"
7+
readme = "README.md"
8+
packages = [{include = "gemini_example.py"}]
9+
10+
[tool.poetry.scripts]
11+
gemini-example = "gemini_example:main"
12+
13+
[tool.poetry.dependencies]
14+
python = "^3.10"
15+
python-dotenv = ">=1.0.0"
16+
launchdarkly-server-sdk-ai = "^0.17.0"
17+
google-genai = "^1.30.0"
18+
19+
[build-system]
20+
requires = ["poetry-core"]
21+
build-backend = "poetry.core.masonry.api"

examples/judge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ These examples demonstrate how to use LaunchDarkly's judge functionality to eval
1212

1313
## Setup
1414

15-
1. Create a `.env` file in the repository root with the following variables:
15+
1. Create a `.env` file in this directory with the following variables:
1616

1717
```
1818
LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key
@@ -32,7 +32,7 @@ These examples demonstrate how to use LaunchDarkly's judge functionality to eval
3232
2. Install the required dependencies:
3333

3434
```bash
35-
poetry install -E langchain
35+
poetry install
3636
```
3737

3838
## Run

0 commit comments

Comments
 (0)