/
githubmirror
/
workgpt
Обзор
Документация
Войти
/
githubmirror
/
workgpt
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/apis/base.ts
20 строк
537 B
Alex MacCaw
Add new openai functions (#1)
15 июн 2023, 08:07
Не верифицирован
15 июн 2023, 08:07
01ae0c2
Код
Авторство
О чём код?
import { ApiInterface, Invokable } from './types' import { getInvocables } from './helpers/decorators' import { getChatFunction } from './helpers/interface' import { ChatFunction } from '../chat-agents/types' export const invokableMetadataKey = Symbol('invokable') export abstract class Api implements ApiInterface { get namespace() { return this.constructor.name } get functions(): ChatFunction[] { return this.invokables.map(getChatFunction) } get invokables(): Invokable[] { return getInvocables(this) } }