Skip to content

Commit

Permalink
add llm function
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Sep 2, 2023
1 parent 70c54ea commit cd67c65
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
33 changes: 33 additions & 0 deletions database/migrations/2023_09_02_162641_add_llm_function_.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use App\Models\LlmFunction;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
$params = get_fixture_v2('content_to_voice.json', false);
LlmFunction::firstOrCreate([
'label' => 'content_to_voice',
], [
'label' => 'content_to_voice',
'description' => 'Use the string of content to create a voice audio version of the content using an external service',
'parameters' => $params,
'active' => 1,
]);
}

/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};
10 changes: 10 additions & 0 deletions tests/fixtures/content_to_voice.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"type": "object",
"properties": {
"content": {
"type": "string",
"description": "This is the content to convert to an audio file"
}
},
"required": ["content"]
}

0 comments on commit cd67c65

Please sign in to comment.