Nathan.fooo 6ba7fc0317
feat: openai and stabilityai integration (#3439)
* chore: create trait

* test: add tests

* chore: remove log

* chore: disable log
2023-09-21 12:41:52 +08:00

15 lines
305 B
Rust

use anyhow::Error;
use lib_infra::async_trait::async_trait;
mod entities;
pub mod open_ai;
pub mod stability_ai;
#[async_trait]
pub trait TextCompletion: Send + Sync {
type Input: Send + 'static;
type Output;
async fn text_completion(&self, params: Self::Input) -> Result<Self::Output, Error>;
}