mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-22 07:19:07 +00:00
OAI: Tokenize chat completion messages
Since chat completion messages are a structure, format the prompt before checking in the tokenizer. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Tokenization types"""
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import List
|
||||
from typing import Dict, List, Union
|
||||
|
||||
|
||||
class CommonTokenRequest(BaseModel):
|
||||
@@ -23,7 +23,7 @@ class CommonTokenRequest(BaseModel):
|
||||
class TokenEncodeRequest(CommonTokenRequest):
|
||||
"""Represents a tokenization request."""
|
||||
|
||||
text: str
|
||||
text: Union[str, List[Dict[str, str]]]
|
||||
|
||||
|
||||
class TokenEncodeResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user