1<?php
2
3namespace dokuwiki\plugin\aichat\Model\OpenAI;
4
5use dokuwiki\plugin\aichat\Model\Generic\AbstractGenericModel;
6
7/**
8 * Abstract OpenAI Model
9 *
10 * This class provides a basic interface to the OpenAI API
11 */
12abstract class AbstractOpenAIModel extends AbstractGenericModel
13{
14    protected $apiurl = 'https://api.openai.com/v1/';
15
16    protected function getHttpClient()
17    {
18        $http = parent::getHttpClient();
19        $orgKey = $this->getFromConf('org', '');
20        if ($orgKey) {
21            $this->http->headers['OpenAI-Organization'] = $orgKey;
22        }
23
24        return $http;
25    }
26}
27