Back to Prompt Library
implementation
OpenAI Agent Setup with Basic Tool Calling
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Autonomous Crypto Compliance Agent
Format
Code-aware
Lines
29
Sections
4
Linked challenge
Autonomous Crypto Compliance Agent
Prompt source
Original prompt text with formatting preserved for inspection.
29 lines
4 sections
No variables
1 code block
Initialize your OpenAI Agent using the Assistants API. Define a `TransactionMonitor` agent with a tool called `fetch_transactions` that simulates fetching recent crypto transactions from an `Enterprise Transaction API`. Implement a basic `check_compliance` function that the agent can call. Your agent should be able to process a simple query like 'Are there any suspicious transactions?'
```python
from openai import OpenAI
client = OpenAI()
# Assume client.beta.assistants is available for Assistants API
assistant = client.beta.assistants.create(
name="TransactionMonitor",
instructions="You are an expert financial compliance officer. You use provided tools to monitor transactions for suspicious activity.",
model="gpt-4o",
tools=[
{
"type": "function",
"function": {
"name": "fetch_transactions",
"description": "Fetches recent crypto transactions from the Enterprise Transaction API.",
"parameters": {
"type": "object",
"properties": {
"start_time": {"type": "string"}
},
"required": ["start_time"]
},
},
},
# More tools will go here
],
)
# ... rest of the assistant interaction code
```Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.