> For the complete documentation index, see [llms.txt](https://knowly-ai.gitbook.io/langtorch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowly-ai.gitbook.io/langtorch/processor/integration.md).

# Integration

We provide processor integration for OpenAI, CohereAI, and Minimax

以下是OpenAI chat completion的processor，而其他基于LLM Service的processor也大致相同

```java
public class OpenAIChatProcessor implements Processor<MultiChatMessage, ChatMessage> {
  // OpenAiApi instance used for making requests
  private final OpenAIService openAIService;
  // Configuration for the OpenAI Chat Processor
  private final OpenAIChatProcessorConfig openAIChatProcessorConfig;

  @Inject
  public OpenAIChatProcessor(
      OpenAIService openAIService, OpenAIChatProcessorConfig openAIChatProcessorConfig) {
    this.openAIService = openAIService;
    this.openAIChatProcessorConfig = openAIChatProcessorConfig;
  }

  // Method to run the module with the given input and return the output chat message
  @Override
  public ChatMessage run(MultiChatMessage inputData) {}
  @Override
  public ListenableFuture<ChatMessage> runAsync(MultiChatMessage inputData) {}
  
}
```

One-time Initialization: Config + Service&#x20;

query with input
