Skip to content

Commit cf46145

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
docs: LLM - Made it possible to provide message history to CodeChatModel when starting chat.
PiperOrigin-RevId: 550942763
1 parent 9bbf1ea commit cf46145

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

vertexai/language_models/_language_models.py

+4
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ def start_chat(
728728
*,
729729
max_output_tokens: int = _DEFAULT_MAX_OUTPUT_TOKENS,
730730
temperature: float = _DEFAULT_TEMPERATURE,
731+
message_history: Optional[List[ChatMessage]] = None,
731732
) -> "CodeChatSession":
732733
"""Starts a chat session with the code chat model.
733734
@@ -742,6 +743,7 @@ def start_chat(
742743
model=self,
743744
max_output_tokens=max_output_tokens,
744745
temperature=temperature,
746+
message_history=message_history
745747
)
746748

747749

@@ -916,12 +918,14 @@ def __init__(
916918
model: CodeChatModel,
917919
max_output_tokens: int = CodeChatModel._DEFAULT_MAX_OUTPUT_TOKENS,
918920
temperature: float = CodeChatModel._DEFAULT_TEMPERATURE,
921+
message_history: Optional[List[ChatMessage]] = None,
919922
):
920923
super().__init__(
921924
model=model,
922925
max_output_tokens=max_output_tokens,
923926
temperature=temperature,
924927
is_code_chat_session=True,
928+
message_history=message_history,
925929
)
926930

927931
def send_message(

0 commit comments

Comments
 (0)