| 39 | } |
| 40 | |
| 41 | export interface BaseLlmApi { |
| 42 | // Chat, no stream |
| 43 | chatCompletionNonStream( |
| 44 | body: ChatCompletionCreateParamsNonStreaming, |
| 45 | signal: AbortSignal, |
| 46 | ): Promise<ChatCompletion>; |
| 47 | |
| 48 | // Chat, stream |
| 49 | chatCompletionStream( |
| 50 | body: ChatCompletionCreateParamsStreaming, |
| 51 | signal: AbortSignal, |
| 52 | ): AsyncGenerator<ChatCompletionChunk>; |
| 53 | |
| 54 | responsesNonStream?( |
| 55 | body: ChatCompletionCreateParamsNonStreaming, |
| 56 | signal: AbortSignal, |
| 57 | ): Promise<Response>; |
| 58 | |
| 59 | responsesStream?( |
| 60 | body: ChatCompletionCreateParamsStreaming, |
| 61 | signal: AbortSignal, |
| 62 | ): AsyncGenerator<ChatCompletionChunk>; |
| 63 | |
| 64 | // Completion, no stream |
| 65 | completionNonStream( |
| 66 | body: CompletionCreateParamsNonStreaming, |
| 67 | signal: AbortSignal, |
| 68 | ): Promise<Completion>; |
| 69 | |
| 70 | // Completion, stream |
| 71 | completionStream( |
| 72 | body: CompletionCreateParamsStreaming, |
| 73 | signal: AbortSignal, |
| 74 | ): AsyncGenerator<Completion>; |
| 75 | |
| 76 | // FIM, stream |
| 77 | fimStream( |
| 78 | body: FimCreateParamsStreaming, |
| 79 | signal: AbortSignal, |
| 80 | ): AsyncGenerator<ChatCompletionChunk>; |
| 81 | |
| 82 | // Embeddings |
| 83 | embed(body: EmbeddingCreateParams): Promise<CreateEmbeddingResponse>; |
| 84 | |
| 85 | // Reranking |
| 86 | rerank(body: RerankCreateParams): Promise<CreateRerankResponse>; |
| 87 | |
| 88 | // List Models |
| 89 | list(): Promise<Model[]>; |
| 90 | } |
no outgoing calls
no test coverage detected