mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
feat: upgrade assistant to 0.6,0
This commit is contained in:
@@ -69,11 +69,15 @@ App::post('/v1/console/assistant')
|
||||
->label('abuse-limit', 15)
|
||||
->label('abuse-key', 'userId:{userId}')
|
||||
->param('prompt', '', new Text(2000), 'Prompt. A string containing questions asked to the AI assistant.')
|
||||
->param('systemPrompt', '', new Text(2000), 'System Prompt. A string containing context to help the AI assistant provide better responses.')
|
||||
->inject('response')
|
||||
->action(function (string $prompt, Response $response) {
|
||||
->action(function (string $prompt, string $systemPrompt, Response $response) {
|
||||
$ch = curl_init('http://appwrite-assistant:3003/');
|
||||
$responseHeaders = [];
|
||||
$query = json_encode(['prompt' => $prompt]);
|
||||
$query = json_encode([
|
||||
'prompt' => $prompt,
|
||||
'systemPrompt' => $systemPrompt,
|
||||
]);
|
||||
$headers = ['accept: text/event-stream'];
|
||||
$handleEvent = function ($ch, $data) use ($response) {
|
||||
$response->chunk($data);
|
||||
|
||||
+1
-1
@@ -868,7 +868,7 @@ services:
|
||||
|
||||
appwrite-assistant:
|
||||
container_name: appwrite-assistant
|
||||
image: appwrite/assistant:0.5.0
|
||||
image: appwrite/assistant:0.6.0
|
||||
networks:
|
||||
- appwrite
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user