Skip to content

Commit 88cc2b3

Browse files
authored
Merge pull request #200 from aristotle-ai/main
Support for OpenAI Agents SDK, update Trace in Langchain-RAG, Multiple bug-fixes
2 parents e0015cc + 3f32f91 commit 88cc2b3

File tree

15 files changed

+345
-247
lines changed

15 files changed

+345
-247
lines changed

examples/autogen/crisis_response_coordinator/OAI_CONFIG_LIST.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

examples/autogen/crisis_response_coordinator/crisis_response_coordinator.py

Lines changed: 0 additions & 192 deletions
This file was deleted.

examples/autogen/crisis_response_coordinator/requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/autogen/crisis_response_coordinator/sample.env

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/crewai/scifi_writer/scifi_writer.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import sys
2-
sys.path.append('.')
3-
4-
from ragaai_catalyst import RagaAICatalyst, init_tracing
5-
from ragaai_catalyst.tracers import Tracer
6-
71
import os
82
from dotenv import load_dotenv
93
from crewai import Agent, Task, Crew, Process
104
from crewai.tools import tool
115
from typing import Any
126

7+
from ragaai_catalyst import RagaAICatalyst, init_tracing
8+
from ragaai_catalyst.tracers import Tracer
139

1410
load_dotenv()
1511

@@ -98,4 +94,4 @@ def write_to_file(filename: str, content: str) -> str:
9894
print("\nGenerated Story Content:")
9995
print(file.read())
10096
except FileNotFoundError:
101-
print("Story file not found. Check the writer agent's execution.")
97+
print("Story file not found. Check the writer agent's execution.")

examples/openai_agents_sdk/README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Email Data Extraction with OpenAI Agents SDK
2+
3+
This example demonstrates how to use the OpenAI Agents SDK with RagaAI Catalyst to extract structured information from emails.
4+
5+
## Overview
6+
7+
The application uses OpenAI's Agents SDK to parse unstructured email text and extract key information such as:
8+
- Email subject and sender details
9+
- Main discussion points
10+
- Meeting information (date, time, location)
11+
- Action items and tasks with assignees
12+
- Next steps
13+
14+
The extracted data is structured using Pydantic models for easy manipulation and validation.
15+
16+
## Requirements
17+
18+
- Python 3.8+
19+
- OpenAI API key
20+
- RagaAI Catalyst credentials
21+
22+
## Installation
23+
24+
1. Clone the repository
25+
2. Install the required dependencies:
26+
```bash
27+
pip install -r requirements.txt
28+
```
29+
3. Copy [sample.env](cci:7://file:///Users/ragaai_user/work/ragaai-catalyst/examples/openai_agents_sdk/sample.env:0:0-0:0) to [.env](cci:7://file:///Users/ragaai_user/work/ragaai-catalyst/examples/openai_agents_sdk/sample.env:0:0-0:0) and fill in your API keys:
30+
```bash
31+
cp sample.env .env
32+
```
33+
34+
## Environment Variables
35+
36+
Configure the following environment variables in your [.env](cci:7://file:///Users/ragaai_user/work/ragaai-catalyst/examples/openai_agents_sdk/sample.env:0:0-0:0) file:
37+
38+
- `OPENAI_API_KEY`: Your OpenAI API key
39+
- `CATALYST_ACCESS_KEY`: Your RagaAI Catalyst access key
40+
- `CATALYST_SECRET_KEY`: Your RagaAI Catalyst secret key
41+
- `CATALYST_BASE_URL`: RagaAI Catalyst base URL
42+
- `PROJECT_NAME`: Name for your project in RagaAI Catalyst (default: 'email-extraction')
43+
- `DATASET_NAME`: Name for your dataset in RagaAI Catalyst (default: 'email-data')
44+
45+
## Usage
46+
47+
Run the example script:
48+
49+
```bash
50+
python data_extraction_email.py
51+
```
52+
The script will:
53+
54+
1. Initialize the RagaAI Catalyst client for tracing
55+
2. Set up an OpenAI Agent with appropriate instructions
56+
3. Process a sample email to extract structured data
57+
4. Display the extracted information
58+
59+
## Customization
60+
61+
You can modify the `sample_email` variable in the script to process different emails, or adapt the code to read emails from files or an API.
62+
63+
The Pydantic models (`Person`, `Meeting`, `Task`, `EmailData`) can be extended to capture additional information as needed.
64+
65+
## Integration with RagaAI Catalyst
66+
67+
This example integrates with RagaAI Catalyst for tracing and monitoring agent interactions. The integration helps with:
68+
69+
- Tracking agent performance
70+
- Debugging complex agent workflows
71+
- Collecting data for future improvements

0 commit comments

Comments
 (0)