Why Use OpenAI?
The /openai
command gives you access to OpenAI’s models. Perfect for:
- Natural language processing
- Content generation
- Data analysis
- Problem-solving
- Creative writing
- Tool selection
Basic Usage
Simply use the command followed by your query:
/openai Analyze market trends in the renewable energy sector
with file market_data.csv
You can also provide multiple documents:
/openai Compare Q4 performance across regions
with file q4_north.csv
with file q4_south.csv
Or no documents at all:
/openai Compare nano and micro-nano batteries
Model Selection
You can specify which OpenAI model you want to use:
/openai use gpt-4o-mini
Convert the following text to a json format:
[text]
See most recent open AI documentation for available models.
See: https://platform.openai.com/docs/models
Most LLMs support the concept of tools - which is a way to prepare an API call to external functions. We support this in the /openai
command. It can be handy espcially when calling external APIs or when you want to call an automation that you’ve put behind a Pinkfish API endpoint.
See: https://platform.openai.com/docs/guides/function-calling
/openai What's the current weather in Copenhagen in farenheight?
"tools": [
{
"type": "function",
"function": {
"name": "getWeather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City name or coordinates"
},
"units": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "Temperature units"
}
},
"required": ["location"]
}
}
}
]
Tool choice: [auto]
Sample response:
{
"output": {
"tool_calls": [
{
"id": "call_QEXgadie2OaO7o6Te26E1qOl",
"type": "function",
"function": {
"name": "getWeather",
"arguments": "{\"location\":\"Copenhagen\",\"units\":\"fahrenheit\"}"
}
}
],
"content": null
}
}
You can control how tools are used with tool_choices
:
/openai Analyze market data
tool_choices = ["auto"] // Let the model choose which tools to use
with file market_data.csv
/openai Analyze market data
tool_choices = ["none"] // Prevent the model from using any tools
with file market_data.csv
/openai What's the weather?
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string"}
}
}
}
}
]
tool_choices = [{"type": "function", "function": {"name": "get_weather"}}] // Force use of specific tool