No description
| Extracted | ||
| .DS_Store | ||
| .gitignore | ||
| assistant_extractor.py | ||
| README.md | ||
| requirements.txt | ||
OpenAI Assistant Data Extractor
A Python tool to extract comprehensive data from OpenAI assistants and export it to CSV format with separate files for JSON schemas.
Features
- List all assistants in your OpenAI organization
- Extract key data including:
- Assistant name and ID
- System instructions
- Model information
- Creation timestamp
- Attached vector stores and their names
- Function tools and their JSON schemas
- Response format schemas (structured outputs)
- Export to CSV with references to separate schema files
- Automatic pagination handling for large numbers of assistants
- Schema file generation for complex JSON structures
Installation
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
Usage
-
Set your OpenAI API key:
export OPENAI_API_KEY=your_api_key_here -
Run the extractor:
python assistant_extractor.py
Output
The tool generates several files:
CSV File
assistants_data.csv- Main data export with columns:assistant_id- Unique OpenAI assistant identifierassistant_name- Display name of the assistantsystem_instructions- The assistant's system promptvector_store_ids- Comma-separated list of attached vector store IDsvector_store_names- Human-readable names and IDs of vector storesfunction_tools- Comma-separated list of function tool namesfunction_schemas- Reference to function schema file (if any)response_format_schema_file- Reference to response format schema file (if any)model- AI model used by the assistantcreated_at- Timestamp when assistant was created
Schema Files
function_schemas_{assistant_id}.txt- Function tool parameter schemasresponse_format_schema_{assistant_id}.json- Structured output schemas
Requirements
- Python 3.7+
- OpenAI API key with access to Assistants API
openaiPython package (>=1.3.0)
Error Handling
- Handles API rate limits and pagination automatically
- Creates error references in CSV if schema extraction fails
- Continues processing other assistants if individual assistant extraction fails
Example Output
Extracting assistant data...
Found 3 assistants
Data exported to assistants_data.csv
Summary:
- Customer Support Bot (asst_abc123)
Vector Stores: Knowledge Base (vs_def456)
Function Tools: get_order_status, process_refund
Function Schemas: function_schemas_asst_abc123.txt
Response Format Schema: response_format_schema_asst_abc123.json
License
MIT License