Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build/
.vscode/
env/
venv/
.venv/
flake8.out
pylint.out
posthog-analytics
Expand Down
8 changes: 4 additions & 4 deletions examples/example-ai-anthropic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Track Anthropic Claude API calls with PostHog.
## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env
uv sync
```
Comment thread
richardsolomou marked this conversation as resolved.

## Examples
Expand All @@ -20,7 +20,7 @@ cp .env.example .env

```bash
source .env
python chat.py
python streaming.py
python extended_thinking.py
uv run python chat.py
uv run python streaming.py
uv run python extended_thinking.py
```
8 changes: 8 additions & 0 deletions examples/example-ai-anthropic/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "example-ai-anthropic"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"posthog==7.9.12",
"anthropic==0.86.0",
]
2 changes: 0 additions & 2 deletions examples/example-ai-anthropic/requirements.txt

This file was deleted.

581 changes: 581 additions & 0 deletions examples/example-ai-anthropic/uv.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/example-ai-gemini/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Track Google Gemini API calls with PostHog.
## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env
uv sync
```

## Examples
Expand All @@ -20,7 +20,7 @@ cp .env.example .env

```bash
source .env
python chat.py
python streaming.py
python image_generation.py
uv run python chat.py
uv run python streaming.py
uv run python image_generation.py
```
8 changes: 8 additions & 0 deletions examples/example-ai-gemini/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "example-ai-gemini"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"posthog==7.9.12",
"google-genai==1.68.0",
]
2 changes: 0 additions & 2 deletions examples/example-ai-gemini/requirements.txt

This file was deleted.

744 changes: 744 additions & 0 deletions examples/example-ai-gemini/uv.lock

Large diffs are not rendered by default.

12 changes: 3 additions & 9 deletions examples/example-ai-langchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ Track LangChain LLM calls with PostHog.
## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env
```

For the OTEL example, also install:

```bash
pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http
uv sync
```

## Examples
Expand All @@ -25,6 +19,6 @@ pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http

```bash
source .env
python callback_handler.py
python otel.py
uv run python callback_handler.py
uv run python otel.py
```
11 changes: 11 additions & 0 deletions examples/example-ai-langchain/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[project]
name = "example-ai-langchain"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"posthog==7.9.12",
"langchain==1.2.13",
"langchain-openai==1.1.12",
"opentelemetry-sdk==1.40.0",
"opentelemetry-exporter-otlp-proto-http==1.40.0",
]
3 changes: 0 additions & 3 deletions examples/example-ai-langchain/requirements.txt

This file was deleted.

1,523 changes: 1,523 additions & 0 deletions examples/example-ai-langchain/uv.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/example-ai-litellm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Track LiteLLM calls with PostHog using the built-in callback integration.
## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env
uv sync
```

## Examples
Expand All @@ -19,6 +19,6 @@ cp .env.example .env

```bash
source .env
python chat.py
python streaming.py
uv run python chat.py
uv run python streaming.py
```
8 changes: 8 additions & 0 deletions examples/example-ai-litellm/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "example-ai-litellm"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"posthog==7.9.12",
"litellm==1.81.13",
]
2 changes: 0 additions & 2 deletions examples/example-ai-litellm/requirements.txt

This file was deleted.

2,085 changes: 2,085 additions & 0 deletions examples/example-ai-litellm/uv.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/example-ai-openai-agents/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Track OpenAI Agents SDK calls with PostHog.
## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env
uv sync
```

## Examples
Expand All @@ -21,8 +21,8 @@ cp .env.example .env

```bash
source .env
python multi_agent.py
python single_agent.py
python guardrails.py
python custom_spans.py
uv run python multi_agent.py
uv run python single_agent.py
uv run python guardrails.py
uv run python custom_spans.py
```
8 changes: 8 additions & 0 deletions examples/example-ai-openai-agents/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "example-ai-openai-agents"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"posthog==7.9.12",
"openai-agents==0.13.1",
]
2 changes: 0 additions & 2 deletions examples/example-ai-openai-agents/requirements.txt

This file was deleted.

1,115 changes: 1,115 additions & 0 deletions examples/example-ai-openai-agents/uv.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions examples/example-ai-openai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Track OpenAI API calls with PostHog.
## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env
uv sync
```

## Examples
Expand All @@ -24,11 +24,11 @@ cp .env.example .env

```bash
source .env
python chat_completions.py
python chat_completions_streaming.py
python responses.py
python responses_streaming.py
python embeddings.py
python transcription.py
python image_generation.py
uv run python chat_completions.py
uv run python chat_completions_streaming.py
uv run python responses.py
uv run python responses_streaming.py
uv run python embeddings.py
uv run python transcription.py
uv run python image_generation.py
```
8 changes: 8 additions & 0 deletions examples/example-ai-openai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[project]
name = "example-ai-openai"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"posthog==7.9.12",
"openai==2.29.0",
]
2 changes: 0 additions & 2 deletions examples/example-ai-openai/requirements.txt

This file was deleted.

593 changes: 593 additions & 0 deletions examples/example-ai-openai/uv.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/example-ai-pydantic-ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Track Pydantic AI agent calls with PostHog via OpenTelemetry.
## Setup

```bash
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env
uv sync
```

## Examples
Expand All @@ -18,5 +18,5 @@ cp .env.example .env

```bash
source .env
python agent_with_otel.py
uv run python agent_with_otel.py
```
10 changes: 10 additions & 0 deletions examples/example-ai-pydantic-ai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[project]
name = "example-ai-pydantic-ai"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
"posthog==7.9.12",
"pydantic-ai==1.71.0",
"opentelemetry-sdk==1.39.1",
"opentelemetry-exporter-otlp-proto-http==1.39.1",
]
4 changes: 0 additions & 4 deletions examples/example-ai-pydantic-ai/requirements.txt

This file was deleted.

Loading
Loading