Metadata-Version: 2.4
Name: cracked-ai-openai-agents
Version: 0.1.0
Summary: OpenAI Agents SDK function tools for Cracked, the agent tool router.
License: MIT
Project-URL: Documentation, https://cracked.ai/docs/sdks
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: cracked-ai>=0.1.0
Requires-Dist: openai-agents>=0.1

# Cracked for the OpenAI Agents SDK

Function tools that give an `agents.Agent` 50,000+ tools through one API key.

Publishing to PyPI soon. Until then install from the repo path:

```bash
pip install ./sdk/python ./sdk/integrations/openai-agents openai-agents
# later: pip install cracked-ai-openai-agents
```

Set `CRACKED_API_KEY` (https://cracked.ai/app/keys, or `Cracked.register_agent()`) and `OPENAI_API_KEY`.

## Use

```python
from agents import Agent, Runner
from cracked_ai_openai_agents import cracked_toolkit

agent = Agent(
    name="Researcher",
    instructions="Find the right tool with cracked_discover, read its schema with cracked_inspect, then cracked_run it. Quote output fields, never invent data.",
    tools=cracked_toolkit(),   # cracked_discover, cracked_inspect, cracked_run, cracked_run_capability
)
print(Runner.run_sync(agent, "What is the weather in Austin, TX right now?").final_output)
```

Pre-resolved tools, one per endpoint with the provider's JSON Schema as the tool parameters:

```python
from cracked_ai_openai_agents import cracked_tools
agent = Agent(name="IG", instructions="...", tools=cracked_tools("instagram profile followers", limit=3))
```

Notes:
- `cracked_run` / `cracked_run_capability` take `input_json` (a JSON object string) because strict function schemas do not allow free-form objects.
- `cracked_tools()` builds `FunctionTool`s with `strict_json_schema=False` so optional provider fields work.
- `make_functions()` returns the four plain Python functions if you want to wrap them yourself.

`python example.py` calls the functions directly (no LLM) and, with `OPENAI_API_KEY`, runs a one-turn agent.
