File size: 391 Bytes
dc465b0
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
from .base import BaseAPI
from typing import List

class OpenAIAPI(BaseAPI):
    def get_caption(self, prompt: str, user_prompt: str, images_base64: List[str]) -> str:
        url_suffix = f'/v1/completions'
        return super().get_caption(prompt, user_prompt, images_base64, url_suffix)

    def parse_response(self, response: dict) -> str:
        return response['choices'][0]['text']