openfiles-ai


Nameopenfiles-ai JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/openfiles-ai/openfiles
SummaryOpenFiles SDK - AI-native file storage for your AI agents
upload_time2025-08-26 20:30:38
maintainerNone
docs_urlNone
authorOpenFiles AI
requires_python>=3.9
licenseMIT
keywords openfiles file-storage ai sdk s3-style version-control
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenFiles - Persistent File Storage for AI Agents (Python SDK)

OpenFiles gives your AI agents the ability to create, read, and manage files. Seamless OpenAI SDK integration with automatic file operations. Your AI agents can now save their work - reports, code, documents, data - with zero infrastructure setup.

## 🚀 Quick Start

```bash
pip install openfiles-ai
```

### OpenAI Integration
```python
# Before: from openai import OpenAI
# After:  from openfiles_ai import OpenAI

ai = OpenAI(
    api_key='sk_your_openai_key',           # Same as before
    openfiles_api_key='oa_your_key',    # Add this
    base_path='company/reports'             # Optional: organize files
)

# Everything else works exactly the same!
response = await ai.chat.completions.create(
    model='gpt-4',
    messages=[{'role': 'user', 'content': 'Generate quarterly business report'}],
)

# AI creates the file and responds with confirmation
print(response.choices[0].message.content)
# "I've generated a comprehensive Q1 2025 business report and saved it as company/reports/quarterly-report-q1-2025.md. The report includes financial metrics, growth analysis, and strategic recommendations."
```

## 📦 Package Structure

The SDK provides three distinct layers for different use cases:

| Layer | Import Path | Use Case | Best For |
|-------|-------------|----------|----------|
| **OpenAI** | `openfiles_ai.OpenAI` | OpenAI SDK integration | Existing OpenAI codebases |
| **Tools** | `openfiles_ai.tools.OpenFilesTools` | Framework-agnostic tools | Any AI framework (Anthropic, Cohere, etc.) |
| **Core** | `openfiles_ai.OpenFilesClient` | Direct API client | Custom integrations, frameworks |

## 📄 File Type Support

| File Category | Core Layer | Tools Layer | OpenAI Layer |
|---------------|------------|-------------|--------------|
| **Text Files** | ✅ | ✅ | ✅ |
| **Binary Files** | ✅ | 🚧 Coming Soon | 🚧 Coming Soon |

### Supported File Types

**✅ Text Files (All Layers)**
- Documents: `.md`, `.txt`, `.rtf`
- Code: `.js`, `.ts`, `.py`, `.java`, `.html`, `.css`
- Data: `.json`, `.csv`, `.yaml`, `.xml`, `.toml`
- Config: `.env`, `.ini`, `.conf`

**✅ Binary Files (Core Layer Only)**
- Images: `.png`, `.jpg`, `.gif`, `.webp`, `.bmp`, `.svg`
- Audio: `.mp3`, `.wav`, `.ogg`
- Documents: `.pdf`
- Archives: `.zip`

*Binary file support for Tools and OpenAI layers coming soon.*

---

## 🤖 OpenAI Layer (`openfiles_ai.OpenAI`)

Seamless OpenAI client integration with automatic file operations.

### Features
- ✅ **Zero code changes** - only change import path
- ✅ Automatic tool injection and execution
- ✅ Full OpenAI Python SDK compatibility
- ✅ Enhanced callbacks for monitoring
- ✅ Preserves all original OpenAI functionality

### Usage

**Before (using OpenAI directly):**
```python
from openai import OpenAI

ai = OpenAI(api_key='sk_your_openai_key')

response = await ai.chat.completions.create(
    model='gpt-4',
    messages=[{'role': 'user', 'content': 'Create a quarterly business report document'}],
    tools=[# manually define file tools #]
)

# Manually handle tool calls...
if response.choices[0].message.tool_calls:
    # Execute each tool call manually
    # Handle errors and retries
    # Make another API call with tool results
    # Complex multi-step workflow
```

**After (using OpenFiles):**
```python
from openfiles_ai import OpenAI  # Only this changes!

ai = OpenAI(
    api_key='sk_your_openai_key',           # Same
    openfiles_api_key='oa_your_key',    # Add this
    base_path='business/reports'            # Optional: organize files
)

response = await ai.chat.completions.create(
    model='gpt-4',
    messages=[{'role': 'user', 'content': 'Create a quarterly business report document'}],
    # tools auto-injected, sequential execution for reliability
)

# AI responds with confirmation of completed file operations
print(response.choices[0].message.content)
# Example: "I've created the quarterly business report document and saved it as business/reports/quarterly-report-q1-2025.md..."
```

### Enhanced Configuration

```python
ai = OpenAI(
    # All standard OpenAI options work
    api_key='sk_your_openai_key',
    
    # OpenFiles additions
    openfiles_api_key='oa_your_key',
    
    # Optional monitoring callbacks
    on_file_operation=lambda op: print(f"📁 {op.action}: {op.path}"),
    on_tool_execution=lambda exec: print(f"🔧 {exec.function} ({exec.duration}ms)"),
    on_error=lambda error: print(f"❌ Error: {error.message}")
)
```

### Organized File Operations with BasePath

Create structured file organization for your AI operations:

```python
from openfiles_ai import OpenAI

# Option 1: Constructor BasePath (all operations scoped)
project_ai = OpenAI(
    api_key='sk_your_openai_key',
    openfiles_api_key='oa_your_key',
    base_path='projects/ecommerce-site',
    on_file_operation=lambda op: print(f"📁 {op.action}: {op.path}")
)

# Option 2: Create scoped clients for different areas
main_ai = OpenAI(
    api_key='sk_your_openai_key',
    openfiles_api_key='oa_your_key'
)

frontend_ai = main_ai.with_base_path('frontend')
backend_ai = main_ai.with_base_path('backend')
docs_ai = main_ai.with_base_path('documentation')

# Each AI client operates in its own file namespace
response1 = await frontend_ai.chat.completions.create(
    model='gpt-4',
    messages=[{'role': 'user', 'content': 'Create React components for the header'}]
)
# Creates files under 'frontend/' automatically

response2 = await backend_ai.chat.completions.create(
    model='gpt-4',
    messages=[{'role': 'user', 'content': 'Generate Python API models'}]
)
# Creates files under 'backend/' automatically

response3 = await docs_ai.chat.completions.create(
    model='gpt-4',
    messages=[{'role': 'user', 'content': 'Write API documentation'}]
)
# Creates files under 'documentation/' automatically
```

---

## 🛠️ Tools Layer (`openfiles_ai.tools.OpenFilesTools`)

Framework-agnostic tool definitions compatible with any AI platform that supports tool calling.

### Features
- ✅ OpenAI-compatible tool definitions
- ✅ Works with any AI framework (Anthropic Claude, Cohere, etc.)
- ✅ Automatic tool execution
- ✅ Selective processing (only handles OpenFiles tools)
- ✅ Rich error handling and callbacks

### Usage
```python
from openfiles_ai import OpenFilesClient
from openfiles_ai.tools import OpenFilesTools

client = OpenFilesClient(api_key='oa_your_key')
tools = OpenFilesTools(client)

# Use with any AI framework
response = await your_ai_client.chat(
    messages=[{'role': 'user', 'content': 'Create a company policy document'}],
    tools=[
        *[tool.to_dict() for tool in tools.definitions],  # OpenFiles file tools
        *my_custom_tools       # Your other tools
    ]
)

# Process only OpenFiles tools
processed = await tools.process_tool_calls(response)
if processed.handled:
    print(f"Processed {len(processed.results)} file operations")
    for result in processed.results:
        if result.status == 'success':
            print(f"✅ {result.function}: {result.data.path if result.data else 'completed'}")
```

### Tool Definitions

| Tool | Description | Use Case |
|------|-------------|----------|
| `write_file` | Create new file | AI generates reports, documentation, configurations from scratch |
| `read_file` | Read and display file | AI reviews existing content before making changes or answering questions |
| `edit_file` | Modify specific text | AI fixes typos, updates values, refactors specific sections |
| `list_files` | Browse directory | AI explores document structure to understand available files |
| `append_to_file` | Add content to end | AI adds new entries to logs, lists, or ongoing documents |
| `overwrite_file` | Replace entire content | AI completely rewrites outdated files with new content |
| `get_file_metadata` | Get file info only | AI checks file size, version, modification dates for decisions |
| `get_file_versions` | Access file history | AI reviews changes over time or reverts to previous versions |

---

## 🔧 Core Layer (`openfiles_ai.OpenFilesClient`)

Direct API client for OpenFiles platform with complete file operations.

### Features
- ✅ **8 file operations** (write, read, edit, list, append, overwrite, get_metadata, get_versions)
- ✅ Version control with automatic versioning
- ✅ Simple path conventions (no leading slashes)
- ✅ Python-first with full type safety (Pydantic models)
- ✅ Comprehensive error handling with logging

### Usage

```python
from openfiles_ai import OpenFilesClient
import os

client = OpenFilesClient(
    api_key=os.getenv('OPENFILES_API_KEY'),
    base_path='company/reports'  # Organize all reports under this path
)

# Write a file (creates 'company/reports/quarterly-report.md')
result = await client.write_file(
    path='quarterly-report.md',
    content='# Q1 2025 Report\n\nRevenue increased 15%...',
    content_type='text/markdown'
)

# Read the file back
content_response = await client.read_file(path='quarterly-report.md')
content = content_response.data.content

# Edit the file
await client.edit_file(
    path='quarterly-report.md',
    old_string='Revenue increased 15%',
    new_string='Revenue increased 18%'
)

# Get file metadata
metadata_response = await client.get_metadata(path='quarterly-report.md')
metadata = metadata_response.data
print(f"File version: {metadata.version}, Size: {metadata.size} bytes")
```

---

## 🔄 Which Layer Should I Use?

| | OpenAI Layer | Tools Layer | Core Layer |
|--|-------------|-------------|-----------|
| **👥 Best For** | **Existing OpenAI apps** | Multi-framework developers | Custom integrations |
| **⭐ Difficulty** | **⭐ Easiest** | ⭐⭐ Medium | ⭐⭐⭐ Advanced |
| **🔧 Setup** | **Change import only** | Add tools + handle calls | Direct API integration |
| **🤖 AI Framework** | **OpenAI (Others coming soon)** | Any framework | Direct API |
| **⚙️ Tool Management** | **Fully automatic** | Manual processing | No tools (direct API) |
| **🎛️ Control Level** | **Plug & play** | Moderate control | Full control |

---

## 🔑 Authentication

Get your API key from [OpenFiles Console](https://console.openfiles.ai):

1. Sign up with GitHub OAuth
2. Generate API key in Settings
3. Use format: `oa_xxxxxxxxxxxxxxxxxxxxxxxxxxxx`

```python
import os
from openfiles_ai import OpenFilesClient

# Environment variables (recommended)
client = OpenFilesClient(
    api_key=os.getenv('OPENFILES_API_KEY'),
    base_path='my-project'  # Optional: organize files by project
)
```

---

## 🎯 Best Practices

### File Paths
- Use simple paths: `reports/quarterly-report-q1.md` ✅
- No leading slashes: `/reports/quarterly-report.md` ❌
- Use forward slashes on all platforms
- Keep paths descriptive and organized

### Error Handling
```python
from openfiles_ai import OpenFilesClient
from openfiles_ai.core.exceptions import FileOperationError

client = OpenFilesClient(api_key='oa_your_key')

try:
    await client.write_file(
        path='employee-handbook.md', 
        content='Employee handbook content...',
        content_type='text/markdown'
    )
except FileOperationError as error:
    if error.status_code == 409:
        # File already exists - use edit_file or overwrite_file instead
        await client.overwrite_file(
            path='employee-handbook.md',
            content='Updated employee handbook content...'
        )
    print(f'Operation failed: {error.message}')
```

---

## 🗺️ Roadmap

### **🚧 Coming Soon**
- **Delete Operation** - Remove files and folders
- **Anthropic Claude Support** - Native drop-in replacement for Claude
- **Google Gemini Support** - Native drop-in replacement for Gemini
- **Semantic Search** - AI-powered file discovery
- **Binary File Support for Tools & OpenAI Layers** - Currently only Core layer supports binary files

### **🔮 Future Features**
- **More AI Providers** - Cohere, Mistral, and local models
- **Real-time Sync** - WebSocket support for live file updates
- **File Sharing** - Share files between projects and teams
- **Multi-agent Workflows** - Advanced agent coordination
- **Plugin Ecosystem** - Community-built integrations

---

## 📖 Complete Examples

The examples in this README demonstrate:
- **Core API Integration** - Direct file operations with organized structure
- **Tools Integration** - Framework-agnostic AI tool usage  
- **OpenAI Integration** - Drop-in replacement with automatic file operations

Each example demonstrates session isolation, business-focused use cases, and covers all SDK features.

---

## 🤝 Support

- [GitHub Issues](https://github.com/openfiles-ai/openfiles/issues)
- [Documentation](https://github.com/openfiles-ai/openfiles/tree/main/sdks/python)
- [Email Support](mailto:contact@openfiles.ai)

---

**Built for AI agents, by AI enthusiasts** 🤖✨

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openfiles-ai/openfiles",
    "name": "openfiles-ai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "openfiles, file-storage, ai, sdk, s3-style, version-control",
    "author": "OpenFiles AI",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/08/05/b1a18a0076c6a4391b052791c2083ae0327d8126f02c2c3cb96840a8bb7d/openfiles_ai-0.1.2.tar.gz",
    "platform": null,
    "description": "# OpenFiles - Persistent File Storage for AI Agents (Python SDK)\n\nOpenFiles gives your AI agents the ability to create, read, and manage files. Seamless OpenAI SDK integration with automatic file operations. Your AI agents can now save their work - reports, code, documents, data - with zero infrastructure setup.\n\n## \ud83d\ude80 Quick Start\n\n```bash\npip install openfiles-ai\n```\n\n### OpenAI Integration\n```python\n# Before: from openai import OpenAI\n# After:  from openfiles_ai import OpenAI\n\nai = OpenAI(\n    api_key='sk_your_openai_key',           # Same as before\n    openfiles_api_key='oa_your_key',    # Add this\n    base_path='company/reports'             # Optional: organize files\n)\n\n# Everything else works exactly the same!\nresponse = await ai.chat.completions.create(\n    model='gpt-4',\n    messages=[{'role': 'user', 'content': 'Generate quarterly business report'}],\n)\n\n# AI creates the file and responds with confirmation\nprint(response.choices[0].message.content)\n# \"I've generated a comprehensive Q1 2025 business report and saved it as company/reports/quarterly-report-q1-2025.md. The report includes financial metrics, growth analysis, and strategic recommendations.\"\n```\n\n## \ud83d\udce6 Package Structure\n\nThe SDK provides three distinct layers for different use cases:\n\n| Layer | Import Path | Use Case | Best For |\n|-------|-------------|----------|----------|\n| **OpenAI** | `openfiles_ai.OpenAI` | OpenAI SDK integration | Existing OpenAI codebases |\n| **Tools** | `openfiles_ai.tools.OpenFilesTools` | Framework-agnostic tools | Any AI framework (Anthropic, Cohere, etc.) |\n| **Core** | `openfiles_ai.OpenFilesClient` | Direct API client | Custom integrations, frameworks |\n\n## \ud83d\udcc4 File Type Support\n\n| File Category | Core Layer | Tools Layer | OpenAI Layer |\n|---------------|------------|-------------|--------------|\n| **Text Files** | \u2705 | \u2705 | \u2705 |\n| **Binary Files** | \u2705 | \ud83d\udea7 Coming Soon | \ud83d\udea7 Coming Soon |\n\n### Supported File Types\n\n**\u2705 Text Files (All Layers)**\n- Documents: `.md`, `.txt`, `.rtf`\n- Code: `.js`, `.ts`, `.py`, `.java`, `.html`, `.css`\n- Data: `.json`, `.csv`, `.yaml`, `.xml`, `.toml`\n- Config: `.env`, `.ini`, `.conf`\n\n**\u2705 Binary Files (Core Layer Only)**\n- Images: `.png`, `.jpg`, `.gif`, `.webp`, `.bmp`, `.svg`\n- Audio: `.mp3`, `.wav`, `.ogg`\n- Documents: `.pdf`\n- Archives: `.zip`\n\n*Binary file support for Tools and OpenAI layers coming soon.*\n\n---\n\n## \ud83e\udd16 OpenAI Layer (`openfiles_ai.OpenAI`)\n\nSeamless OpenAI client integration with automatic file operations.\n\n### Features\n- \u2705 **Zero code changes** - only change import path\n- \u2705 Automatic tool injection and execution\n- \u2705 Full OpenAI Python SDK compatibility\n- \u2705 Enhanced callbacks for monitoring\n- \u2705 Preserves all original OpenAI functionality\n\n### Usage\n\n**Before (using OpenAI directly):**\n```python\nfrom openai import OpenAI\n\nai = OpenAI(api_key='sk_your_openai_key')\n\nresponse = await ai.chat.completions.create(\n    model='gpt-4',\n    messages=[{'role': 'user', 'content': 'Create a quarterly business report document'}],\n    tools=[# manually define file tools #]\n)\n\n# Manually handle tool calls...\nif response.choices[0].message.tool_calls:\n    # Execute each tool call manually\n    # Handle errors and retries\n    # Make another API call with tool results\n    # Complex multi-step workflow\n```\n\n**After (using OpenFiles):**\n```python\nfrom openfiles_ai import OpenAI  # Only this changes!\n\nai = OpenAI(\n    api_key='sk_your_openai_key',           # Same\n    openfiles_api_key='oa_your_key',    # Add this\n    base_path='business/reports'            # Optional: organize files\n)\n\nresponse = await ai.chat.completions.create(\n    model='gpt-4',\n    messages=[{'role': 'user', 'content': 'Create a quarterly business report document'}],\n    # tools auto-injected, sequential execution for reliability\n)\n\n# AI responds with confirmation of completed file operations\nprint(response.choices[0].message.content)\n# Example: \"I've created the quarterly business report document and saved it as business/reports/quarterly-report-q1-2025.md...\"\n```\n\n### Enhanced Configuration\n\n```python\nai = OpenAI(\n    # All standard OpenAI options work\n    api_key='sk_your_openai_key',\n    \n    # OpenFiles additions\n    openfiles_api_key='oa_your_key',\n    \n    # Optional monitoring callbacks\n    on_file_operation=lambda op: print(f\"\ud83d\udcc1 {op.action}: {op.path}\"),\n    on_tool_execution=lambda exec: print(f\"\ud83d\udd27 {exec.function} ({exec.duration}ms)\"),\n    on_error=lambda error: print(f\"\u274c Error: {error.message}\")\n)\n```\n\n### Organized File Operations with BasePath\n\nCreate structured file organization for your AI operations:\n\n```python\nfrom openfiles_ai import OpenAI\n\n# Option 1: Constructor BasePath (all operations scoped)\nproject_ai = OpenAI(\n    api_key='sk_your_openai_key',\n    openfiles_api_key='oa_your_key',\n    base_path='projects/ecommerce-site',\n    on_file_operation=lambda op: print(f\"\ud83d\udcc1 {op.action}: {op.path}\")\n)\n\n# Option 2: Create scoped clients for different areas\nmain_ai = OpenAI(\n    api_key='sk_your_openai_key',\n    openfiles_api_key='oa_your_key'\n)\n\nfrontend_ai = main_ai.with_base_path('frontend')\nbackend_ai = main_ai.with_base_path('backend')\ndocs_ai = main_ai.with_base_path('documentation')\n\n# Each AI client operates in its own file namespace\nresponse1 = await frontend_ai.chat.completions.create(\n    model='gpt-4',\n    messages=[{'role': 'user', 'content': 'Create React components for the header'}]\n)\n# Creates files under 'frontend/' automatically\n\nresponse2 = await backend_ai.chat.completions.create(\n    model='gpt-4',\n    messages=[{'role': 'user', 'content': 'Generate Python API models'}]\n)\n# Creates files under 'backend/' automatically\n\nresponse3 = await docs_ai.chat.completions.create(\n    model='gpt-4',\n    messages=[{'role': 'user', 'content': 'Write API documentation'}]\n)\n# Creates files under 'documentation/' automatically\n```\n\n---\n\n## \ud83d\udee0\ufe0f Tools Layer (`openfiles_ai.tools.OpenFilesTools`)\n\nFramework-agnostic tool definitions compatible with any AI platform that supports tool calling.\n\n### Features\n- \u2705 OpenAI-compatible tool definitions\n- \u2705 Works with any AI framework (Anthropic Claude, Cohere, etc.)\n- \u2705 Automatic tool execution\n- \u2705 Selective processing (only handles OpenFiles tools)\n- \u2705 Rich error handling and callbacks\n\n### Usage\n```python\nfrom openfiles_ai import OpenFilesClient\nfrom openfiles_ai.tools import OpenFilesTools\n\nclient = OpenFilesClient(api_key='oa_your_key')\ntools = OpenFilesTools(client)\n\n# Use with any AI framework\nresponse = await your_ai_client.chat(\n    messages=[{'role': 'user', 'content': 'Create a company policy document'}],\n    tools=[\n        *[tool.to_dict() for tool in tools.definitions],  # OpenFiles file tools\n        *my_custom_tools       # Your other tools\n    ]\n)\n\n# Process only OpenFiles tools\nprocessed = await tools.process_tool_calls(response)\nif processed.handled:\n    print(f\"Processed {len(processed.results)} file operations\")\n    for result in processed.results:\n        if result.status == 'success':\n            print(f\"\u2705 {result.function}: {result.data.path if result.data else 'completed'}\")\n```\n\n### Tool Definitions\n\n| Tool | Description | Use Case |\n|------|-------------|----------|\n| `write_file` | Create new file | AI generates reports, documentation, configurations from scratch |\n| `read_file` | Read and display file | AI reviews existing content before making changes or answering questions |\n| `edit_file` | Modify specific text | AI fixes typos, updates values, refactors specific sections |\n| `list_files` | Browse directory | AI explores document structure to understand available files |\n| `append_to_file` | Add content to end | AI adds new entries to logs, lists, or ongoing documents |\n| `overwrite_file` | Replace entire content | AI completely rewrites outdated files with new content |\n| `get_file_metadata` | Get file info only | AI checks file size, version, modification dates for decisions |\n| `get_file_versions` | Access file history | AI reviews changes over time or reverts to previous versions |\n\n---\n\n## \ud83d\udd27 Core Layer (`openfiles_ai.OpenFilesClient`)\n\nDirect API client for OpenFiles platform with complete file operations.\n\n### Features\n- \u2705 **8 file operations** (write, read, edit, list, append, overwrite, get_metadata, get_versions)\n- \u2705 Version control with automatic versioning\n- \u2705 Simple path conventions (no leading slashes)\n- \u2705 Python-first with full type safety (Pydantic models)\n- \u2705 Comprehensive error handling with logging\n\n### Usage\n\n```python\nfrom openfiles_ai import OpenFilesClient\nimport os\n\nclient = OpenFilesClient(\n    api_key=os.getenv('OPENFILES_API_KEY'),\n    base_path='company/reports'  # Organize all reports under this path\n)\n\n# Write a file (creates 'company/reports/quarterly-report.md')\nresult = await client.write_file(\n    path='quarterly-report.md',\n    content='# Q1 2025 Report\\n\\nRevenue increased 15%...',\n    content_type='text/markdown'\n)\n\n# Read the file back\ncontent_response = await client.read_file(path='quarterly-report.md')\ncontent = content_response.data.content\n\n# Edit the file\nawait client.edit_file(\n    path='quarterly-report.md',\n    old_string='Revenue increased 15%',\n    new_string='Revenue increased 18%'\n)\n\n# Get file metadata\nmetadata_response = await client.get_metadata(path='quarterly-report.md')\nmetadata = metadata_response.data\nprint(f\"File version: {metadata.version}, Size: {metadata.size} bytes\")\n```\n\n---\n\n## \ud83d\udd04 Which Layer Should I Use?\n\n| | OpenAI Layer | Tools Layer | Core Layer |\n|--|-------------|-------------|-----------|\n| **\ud83d\udc65 Best For** | **Existing OpenAI apps** | Multi-framework developers | Custom integrations |\n| **\u2b50 Difficulty** | **\u2b50 Easiest** | \u2b50\u2b50 Medium | \u2b50\u2b50\u2b50 Advanced |\n| **\ud83d\udd27 Setup** | **Change import only** | Add tools + handle calls | Direct API integration |\n| **\ud83e\udd16 AI Framework** | **OpenAI (Others coming soon)** | Any framework | Direct API |\n| **\u2699\ufe0f Tool Management** | **Fully automatic** | Manual processing | No tools (direct API) |\n| **\ud83c\udf9b\ufe0f Control Level** | **Plug & play** | Moderate control | Full control |\n\n---\n\n## \ud83d\udd11 Authentication\n\nGet your API key from [OpenFiles Console](https://console.openfiles.ai):\n\n1. Sign up with GitHub OAuth\n2. Generate API key in Settings\n3. Use format: `oa_xxxxxxxxxxxxxxxxxxxxxxxxxxxx`\n\n```python\nimport os\nfrom openfiles_ai import OpenFilesClient\n\n# Environment variables (recommended)\nclient = OpenFilesClient(\n    api_key=os.getenv('OPENFILES_API_KEY'),\n    base_path='my-project'  # Optional: organize files by project\n)\n```\n\n---\n\n## \ud83c\udfaf Best Practices\n\n### File Paths\n- Use simple paths: `reports/quarterly-report-q1.md` \u2705\n- No leading slashes: `/reports/quarterly-report.md` \u274c\n- Use forward slashes on all platforms\n- Keep paths descriptive and organized\n\n### Error Handling\n```python\nfrom openfiles_ai import OpenFilesClient\nfrom openfiles_ai.core.exceptions import FileOperationError\n\nclient = OpenFilesClient(api_key='oa_your_key')\n\ntry:\n    await client.write_file(\n        path='employee-handbook.md', \n        content='Employee handbook content...',\n        content_type='text/markdown'\n    )\nexcept FileOperationError as error:\n    if error.status_code == 409:\n        # File already exists - use edit_file or overwrite_file instead\n        await client.overwrite_file(\n            path='employee-handbook.md',\n            content='Updated employee handbook content...'\n        )\n    print(f'Operation failed: {error.message}')\n```\n\n---\n\n## \ud83d\uddfa\ufe0f Roadmap\n\n### **\ud83d\udea7 Coming Soon**\n- **Delete Operation** - Remove files and folders\n- **Anthropic Claude Support** - Native drop-in replacement for Claude\n- **Google Gemini Support** - Native drop-in replacement for Gemini\n- **Semantic Search** - AI-powered file discovery\n- **Binary File Support for Tools & OpenAI Layers** - Currently only Core layer supports binary files\n\n### **\ud83d\udd2e Future Features**\n- **More AI Providers** - Cohere, Mistral, and local models\n- **Real-time Sync** - WebSocket support for live file updates\n- **File Sharing** - Share files between projects and teams\n- **Multi-agent Workflows** - Advanced agent coordination\n- **Plugin Ecosystem** - Community-built integrations\n\n---\n\n## \ud83d\udcd6 Complete Examples\n\nThe examples in this README demonstrate:\n- **Core API Integration** - Direct file operations with organized structure\n- **Tools Integration** - Framework-agnostic AI tool usage  \n- **OpenAI Integration** - Drop-in replacement with automatic file operations\n\nEach example demonstrates session isolation, business-focused use cases, and covers all SDK features.\n\n---\n\n## \ud83e\udd1d Support\n\n- [GitHub Issues](https://github.com/openfiles-ai/openfiles/issues)\n- [Documentation](https://github.com/openfiles-ai/openfiles/tree/main/sdks/python)\n- [Email Support](mailto:contact@openfiles.ai)\n\n---\n\n**Built for AI agents, by AI enthusiasts** \ud83e\udd16\u2728\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "OpenFiles SDK - AI-native file storage for your AI agents",
    "version": "0.1.2",
    "project_urls": {
        "Documentation": "https://github.com/openfiles-ai/openfiles/tree/main/sdks/python",
        "Homepage": "https://github.com/openfiles-ai/openfiles",
        "Issues": "https://github.com/openfiles-ai/openfiles/issues",
        "Repository": "https://github.com/openfiles-ai/openfiles"
    },
    "split_keywords": [
        "openfiles",
        " file-storage",
        " ai",
        " sdk",
        " s3-style",
        " version-control"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "606b740896d213d0f2dcaf0d89d223a8ad7b119ef19ae6317a819c8395519d85",
                "md5": "404cbe136cfedd5dc642f44d1978f5cc",
                "sha256": "00c3b9ac2b63f4492d7f550bc53588de8483da214e1cbd8ae15e0b5a5139fc4c"
            },
            "downloads": -1,
            "filename": "openfiles_ai-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "404cbe136cfedd5dc642f44d1978f5cc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 24196,
            "upload_time": "2025-08-26T20:30:37",
            "upload_time_iso_8601": "2025-08-26T20:30:37.070456Z",
            "url": "https://files.pythonhosted.org/packages/60/6b/740896d213d0f2dcaf0d89d223a8ad7b119ef19ae6317a819c8395519d85/openfiles_ai-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0805b1a18a0076c6a4391b052791c2083ae0327d8126f02c2c3cb96840a8bb7d",
                "md5": "fe33772e661b94f90878a3af9ab49c3a",
                "sha256": "954111ad7c8facf86f4783d6c02cb0008f8682ac2f4cf2b546ce1d03762380f3"
            },
            "downloads": -1,
            "filename": "openfiles_ai-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "fe33772e661b94f90878a3af9ab49c3a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 23604,
            "upload_time": "2025-08-26T20:30:38",
            "upload_time_iso_8601": "2025-08-26T20:30:38.819589Z",
            "url": "https://files.pythonhosted.org/packages/08/05/b1a18a0076c6a4391b052791c2083ae0327d8126f02c2c3cb96840a8bb7d/openfiles_ai-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-26 20:30:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openfiles-ai",
    "github_project": "openfiles",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "openfiles-ai"
}
        
Elapsed time: 1.20838s