feat(core): Support max output tokens parameter (#2218)

This commit is contained in:
Fangyin Cheng
2024-12-18 17:19:18 +08:00
committed by GitHub
parent b05febbf77
commit 7f4b5e79cf
121 changed files with 333 additions and 219 deletions

View File

@@ -230,11 +230,16 @@ class BaseChat(ABC):
chat_mode=self.chat_mode.value(),
span_id=root_tracer.get_current_span_id(),
)
temperature = float(
self._chat_param.get("temperature", self.prompt_template.temperature)
)
max_new_tokens = int(
self._chat_param.get("max_new_tokens", self.prompt_template.max_new_tokens)
)
node = AppChatComposerOperator(
model=self.llm_model,
temperature=self._chat_param.get("temperature")
or float(self.prompt_template.temperature),
max_new_tokens=int(self.prompt_template.max_new_tokens),
temperature=temperature,
max_new_tokens=max_new_tokens,
prompt=self.prompt_template.prompt,
message_version=self._message_version,
echo=self.llm_echo,