Sorry Sir
"// unique identifier key: "
Is it the OpenAI API key?
use Flarum\Extend;
return [
new Blomstra\Redis\Extend\Redis([
'host' => '127.0.0.1',
'password' => ' ',
'port' => ,
'database' => 1,
]),
(new \Flarum\Ai\Extend\Ai(
// unique identifier
key: ' ',
// username or user Id of User to represent
represents: 'chatgpt',
// Chat GPT Model to use. Either \Flarum\Ai\Agent\Model::gpt_3_5_turbo or \Flarum\Ai\Agent\Model::gpt_4
model: \Flarum\Ai\Agent\Model::gpt_3_5_turbo,
// Discussion Id of discussion that contains the instructions
instructions: 7
))
// Chain the call to assign authorizations/permissions
->authorize()
// The tag slug where this authorization applies
->in('*')
// What the Ai can do, full list is in the documentation/readme.
->can(
replyToPosts: true,
respondToMentions: true
)
// Conclude this authorization
->activate()
// Chain another authorization after activate() that applies to this Ai
->authorize()
->in('another-tag')
->can(respondToMentions: true)
->activate(),
];
When I set it to use the user "ID," I get a 404 error.
POST https://flarum.subarist.net/api/discussions
Illuminate\Database\Eloquent\ModelNotFoundException: No query results for model [Flarum\User\User]. in /www/wwwroot/flarum/vendor/illuminate/database/Eloquent/Builder.php:527
Stack trace:
#0 /www/wwwroot/flarum/vendor/flarum/ai-toolkit/src/Agent.php(42): Illuminate\Database\Eloquent\Builder->firstOrFail()
#1 /www/wwwroot/flarum/vendor/flarum/ai-toolkit/src/Agent.php(28): Flarum\Ai\Agent->user()
#2 /www/wwwroot/flarum/vendor/flarum/ai-toolkit/src/Agent/Collection.php(13): Flarum\Ai\Agent->operational()
#3 [internal function]: Flarum\Ai\Agent\Collection->Flarum\Ai\Agent\{closure}()
#4 /www/wwwroot/flarum/vendor/illuminate/collections/Arr.php(717): array_filter()
#5 /www/wwwroot/flarum/vendor/illuminate/collections/Collection.php(358): Illuminate\Support\Arr::where()
If I set it to the username, I don't receive any response.