Back to prompt library
Initial Agent Configuration and Tool Definition
Linked challenge: Global Tax & Legal Compliance Advisor Agent
Prompt source
planning18 lines4 sectionsNo variables1 code block
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}]
# )
```