I am creating a TypeScript API for interacting with different LLM chat completion APIs.…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
I am creating a TypeScript API for interacting with different LLM chat completion APIs. At the core of the API is a function that accepts a chat consisting of several messages or just a single message, and returns a Promise that resolves with the next message in the conversation (= the result of the call to the LLM). Can you suggest good names for the involved types?
Assistant
Here are some suggestions for good names for the types involved in your TypeScript API for interacting with LLM chat completion APIs:
1. Message Types:
ChatMessage: A general type for any message in the conversation.LLMMessage: Specific to messages sent to the LLM.UserMessage: For messages from the user.LLMResponse: For the LLM's generated response.
2. API Interaction Types:
ChatCompletionRequest: Represents the request to the LLM for a chat completion.ChatCompletionResponse: Represents the response from the LLM.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.