xref: /plugin/aichat/Model/ModelInterface.php (revision 4373d2bf7fcddc76e5ba367d903e3d0d86697dff)
1*4373d2bfSAndreas Gohr<?php
2*4373d2bfSAndreas Gohr
3*4373d2bfSAndreas Gohrnamespace dokuwiki\plugin\aichat\Model;
4*4373d2bfSAndreas Gohr
5*4373d2bfSAndreas Gohr/**
6*4373d2bfSAndreas Gohr * Interface for all models
7*4373d2bfSAndreas Gohr *
8*4373d2bfSAndreas Gohr * Model classes should inherit from AbstractModel, to avoid handling the statistics themselves.
9*4373d2bfSAndreas Gohr */
10*4373d2bfSAndreas Gohrinterface ModelInterface
11*4373d2bfSAndreas Gohr{
12*4373d2bfSAndreas Gohr    /**
13*4373d2bfSAndreas Gohr     * The name as used by the LLM provider
14*4373d2bfSAndreas Gohr     *
15*4373d2bfSAndreas Gohr     * @return string
16*4373d2bfSAndreas Gohr     */
17*4373d2bfSAndreas Gohr    public function getModelName();
18*4373d2bfSAndreas Gohr
19*4373d2bfSAndreas Gohr    /**
20*4373d2bfSAndreas Gohr     * Get the price for 1000 tokens
21*4373d2bfSAndreas Gohr     *
22*4373d2bfSAndreas Gohr     * @return float
23*4373d2bfSAndreas Gohr     */
24*4373d2bfSAndreas Gohr    public function get1kTokenPrice();
25*4373d2bfSAndreas Gohr
26*4373d2bfSAndreas Gohr
27*4373d2bfSAndreas Gohr    /**
28*4373d2bfSAndreas Gohr     * Reset the usage statistics
29*4373d2bfSAndreas Gohr     *
30*4373d2bfSAndreas Gohr     * Usually not needed when only handling one operation per request, but useful in CLI
31*4373d2bfSAndreas Gohr     */
32*4373d2bfSAndreas Gohr    public function resetUsageStats();
33*4373d2bfSAndreas Gohr
34*4373d2bfSAndreas Gohr    /**
35*4373d2bfSAndreas Gohr     * Get the usage statistics for this instance
36*4373d2bfSAndreas Gohr     *
37*4373d2bfSAndreas Gohr     * @return string[]
38*4373d2bfSAndreas Gohr     */
39*4373d2bfSAndreas Gohr    public function getUsageStats();
40*4373d2bfSAndreas Gohr}
41