Quellcode durchsuchen

fix: inner invoke llm token too long (#20391)

tags/1.4.2
Novice vor 5 Monaten
Ursprung
Commit
9bbd646f40
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2
    1
      api/core/plugin/backwards_invocation/model.py

+ 2
- 1
api/core/plugin/backwards_invocation/model.py Datei anzeigen

LLMNode.deduct_llm_quota( LLMNode.deduct_llm_quota(
tenant_id=tenant.id, model_instance=model_instance, usage=chunk.delta.usage tenant_id=tenant.id, model_instance=model_instance, usage=chunk.delta.usage
) )
chunk.prompt_messages = []
yield chunk yield chunk


return handle() return handle()
def handle_non_streaming(response: LLMResult) -> Generator[LLMResultChunk, None, None]: def handle_non_streaming(response: LLMResult) -> Generator[LLMResultChunk, None, None]:
yield LLMResultChunk( yield LLMResultChunk(
model=response.model, model=response.model,
prompt_messages=response.prompt_messages,
prompt_messages=[],
system_fingerprint=response.system_fingerprint, system_fingerprint=response.system_fingerprint,
delta=LLMResultChunkDelta( delta=LLMResultChunkDelta(
index=0, index=0,

Laden…
Abbrechen
Speichern