πŸ”ƒ Processor

We introduce the concept of "Processor".

If you are sending requests to an LLM provider, such as OpenAI, think about the processor as a restful API wrapper that takes a request(Input), sends the request to the provider(i.e. OpenAIService), and returns the response(Output).

Take OpenAI API as an example, there are so many endpoints, such as completion, chat completion, embedding creation, etc.

Each of them is a processor as they have different input types, different processing logic, and different output types.

public interface Processor<I extends Input, O extends Output> {
  O run(I inputData);
  ListeanbleFuture<O> runAsync(I inputData);
}

The processor takes an Input and generates Output

Last updated