I tried your prompt and just tweaked the name a bit:
{
"name": "get_stock_moving_average_trend",
"description": "Get the trend of a stock based on its symbol and period. It can be Simple Moving Average or Exponential Moving Average.",
"parameters": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "Stock symbol"
},
"period": {
"type": "number",
"description": "Moving average period"
},
"type": {
"type": "string",
"description": "Moving average type, valid values: sma, ema"
}
},
"required": ["symbol", "period", "type"]
}
}
Using this prompt:
i wanna to know the trend in the following stocks i am interested. APPL, MSFT, GOOGL. say for the last 7 days. for AAPL and MSFT, i want the sma. for GOOGL, i want ema but make the period just 5 days. oh, can you also get AMZN. also sma, also 7 days.
Output:
{
index: 0,
message: {
role: 'assistant',
content: null,
tool_calls: [
{
id: 'call_83hBoQ6Mx144fPB6f3kQVH53',
type: 'function',
function: {
name: 'get_stock_moving_average_trend',
arguments: '{"symbol": "AAPL", "period": 7, "type": "sma"}'
}
},
{
id: 'call_foYfRhd35Ob6ANaUxYArwmzL',
type: 'function',
function: {
name: 'get_stock_moving_average_trend',
arguments: '{"symbol": "MSFT", "period": 7, "type": "sma"}'
}
},
{
id: 'call_JmiRTo6ZykqQyo4afJZbREPV',
type: 'function',
function: {
name: 'get_stock_moving_average_trend',
arguments: '{"symbol": "GOOGL", "period": 5, "type": "ema"}'
}
},
{
id: 'call_eq3ecQGjMdSBKyG80RC3IJtc',
type: 'function',
function: {
name: 'get_stock_moving_average_trend',
arguments: '{"symbol": "AMZN", "period": 7, "type": "sma"}'
}
}
]
},
finish_reason: 'tool_calls'
}