Initial Agent Configuration and Tool Definition

planningChallenge

Prompt Content

You are setting up an OpenAI Assistant for tax and legal compliance. Define an initial Assistant named 'GlobalTaxAdvisor'. Create a custom tool, 'query_legal_database', that takes 'country' and 'keywords' as arguments and returns relevant legal document snippets. Provide the Python code for defining this tool and integrating it with your OpenAI Assistant.

```python
from openai import OpenAI
client = OpenAI()

# Define the tool's function
def query_legal_database(country: str, keywords: str) -> str:
    # This will be replaced by actual Pinecone search
    if country == "Germany" and "corporate tax" in keywords:
        return "According to German Corporate Tax Act §23, the corporate tax rate is 15%."
    return "No relevant information found for the query."

# Add tool to Assistant (conceptual)
# assistant = client.beta.assistants.create(
#     name="GlobalTaxAdvisor",
#     instructions="You are an expert tax and legal advisor...",
#     model="gpt-4o",
#     tools=[{"type": "function", "function": query_legal_database}]
# )
```

Try this prompt

Open the workspace to execute this prompt with free credits, or use your own API keys for unlimited usage.

Usage Tips

Copy the prompt and paste it into your preferred AI tool (Claude, ChatGPT, Gemini)

Customize placeholder values with your specific requirements and context

For best results, provide clear examples and test different variations