1<?php 2 3namespace dokuwiki\plugin\aichat\Model; 4 5/** 6 * Defines a chat completion model 7 */ 8interface ChatInterface extends ModelInterface 9{ 10 /** 11 * Maximum number of tokens the model can output as an answer 12 */ 13 public function getMaxOutputTokenLength(): int; 14 15 /** 16 * The price for 1,000,000 output tokens in USD 17 */ 18 public function getOutputTokenPrice(): float; 19 20 /** 21 * Answer a given question. 22 * 23 * Any prompt, chat history, context etc. will already be included in the $messages array. 24 * 25 * @param array $messages Messages in OpenAI format (with role and content) 26 * @return string The answer 27 * @throws \Exception 28 */ 29 public function getAnswer(array $messages): string; 30} 31