| 99 | |
| 100 | #[async_trait] |
| 101 | pub trait TextGenerator: Generator { |
| 102 | /// Add a message to the chat. |
| 103 | fn add_message(&mut self, message: Message) -> Result<()>; |
| 104 | /// Clear chat history. |
| 105 | fn reset(&mut self) -> Result<()>; |
| 106 | /// clear worker kv cache |
| 107 | async fn goodbye(&mut self) -> Result<()>; |
| 108 | |
| 109 | /// Return the next token. |
| 110 | async fn next_token(&mut self, index: usize) -> Result<Token>; |
| 111 | /// Return the number of generated tokens so far. |
| 112 | fn generated_tokens(&self) -> usize; |
| 113 | } |
| 114 | |
| 115 | #[async_trait] |
| 116 | pub trait ImageGenerator: Generator { |
nothing calls this directly
no outgoing calls
no test coverage detected