This commit is contained in:
Thommy Bucaille 2023-12-28 23:31:28 +01:00
parent 247c43c820
commit 75b9e196b9
1 changed files with 15 additions and 15 deletions

View File

@ -201,23 +201,23 @@ class ChatController extends BaseController
self::$tools = [
[
'type' => 'function',
'function' => [
'name' => 'get_current_weather',
'description' => 'Get the current weather in a given location',
'parameters' => [
'type' => 'object',
'properties' => [
'location' => [
'type' => 'string',
'description' => 'The city and state, e.g. San Francisco, CA',
"type" => "function",
"function" => [
"name" => "get_current_weather",
"description" => "Get the current weather in a given location",
"parameters" => [
"type" => "object",
"properties" => [
"location" => [
"type" => "string",
"description" => "The city and state, e.g. San Francisco, CA",
],
'unit' => [
'type' => 'string',
'enum' => ['celsius', 'fahrenheit']
"unit" => [
"type" => "string",
"enum" => ["celsius", "fahrenheit"]
],
],
'required' => ['location'],
"required" => ["location"],
],
],
],
@ -609,7 +609,7 @@ class ChatController extends BaseController
$result = self::$client->chat()->create([
'model' => config('chat.model'),
'messages' => (array)self::$context_messages,
'tools' => self::$tools,
'tools' => (array)self::$tools,
'user' => Helper::isCLI() ? "system" : Auth::user()->username,
]);