type Model =
| "pplx-7b-chat"
| "pplx-70b-chat"
| "pplx-7b-online"
| "pplx-70b-online"
| "llama-2-70b-chat"
| "codellama-34b-instruct"
| "mistral-7b-instruct"
| "mixtral-8x7b-instruct";
interface Message {
role: "system" | "user" | "assistant";
content: string;
}
interface CompletionChoices {
index: number;
finish_reason: "stop" | "length";
message: Message;
delta: Message;
}
export interface PplxRequest {
model: Model;
messages: Message[];
max_tokens?: number;
temperature?: number;
top_p?: number;
top_k?: number;
stream?: boolean;
presence_penalty?: number;
frequency_penalty?: number;
}
export interface PplxResponse {
id: string;
model: Model;
object: "chat.completion";
created: number;
choices: CompletionChoices[];
error?: {
code: number;
message: string;
type: string;
};
}