mirror of
https://github.com/langgenius/dify.git
synced 2026-06-26 14:51:13 +08:00
fix: relax knowledge retrieval usage schema
This commit is contained in:
parent
8203d42233
commit
7bb4b67885
@ -173,14 +173,6 @@ class InnerKnowledgeRetrieveRequest(BaseModel):
|
||||
class InnerKnowledgeRetrieveUsage(ResponseModel):
|
||||
"""Serialized LLM usage payload returned by dataset retrieval."""
|
||||
|
||||
model_config = ConfigDict(
|
||||
from_attributes=True,
|
||||
extra="forbid",
|
||||
populate_by_name=True,
|
||||
serialize_by_alias=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
prompt_tokens: int
|
||||
completion_tokens: int
|
||||
total_tokens: int
|
||||
|
||||
@ -98,6 +98,8 @@ class TestInnerKnowledgeRetrievalService:
|
||||
"total_price": "0",
|
||||
"currency": "USD",
|
||||
"latency": 0,
|
||||
"time_to_first_token": None,
|
||||
"time_to_generate": None,
|
||||
}
|
||||
mock_rag_cls.return_value = rag
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user