1<?php
2
3namespace dokuwiki\plugin\aichat\Model\Ollama;
4
5use dokuwiki\plugin\aichat\Model\ChatInterface;
6
7class ChatModel extends AbstractOllama implements ChatInterface
8{
9    /** @inheritdoc */
10    public function getAnswer(array $messages): string
11    {
12        $data = [
13            'messages' => $messages,
14            'model' => $this->getModelName(),
15            'stream' => false,
16        ];
17        $response = $this->request('chat', $data);
18        return $response['message']['content'];
19    }
20}
21