Skip to content

Commit

Permalink
docs: LLM - Made it possible to provide message history to `CodeChatM…
Browse files Browse the repository at this point in the history
…odel` when starting chat.

PiperOrigin-RevId: 550942763
  • Loading branch information
vertex-sdk-bot authored and copybara-github committed Jul 25, 2023
1 parent 9bbf1ea commit cf46145
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vertexai/language_models/_language_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ def start_chat(
*,
max_output_tokens: int = _DEFAULT_MAX_OUTPUT_TOKENS,
temperature: float = _DEFAULT_TEMPERATURE,
message_history: Optional[List[ChatMessage]] = None,
) -> "CodeChatSession":
"""Starts a chat session with the code chat model.
Expand All @@ -742,6 +743,7 @@ def start_chat(
model=self,
max_output_tokens=max_output_tokens,
temperature=temperature,
message_history=message_history
)


Expand Down Expand Up @@ -916,12 +918,14 @@ def __init__(
model: CodeChatModel,
max_output_tokens: int = CodeChatModel._DEFAULT_MAX_OUTPUT_TOKENS,
temperature: float = CodeChatModel._DEFAULT_TEMPERATURE,
message_history: Optional[List[ChatMessage]] = None,
):
super().__init__(
model=model,
max_output_tokens=max_output_tokens,
temperature=temperature,
is_code_chat_session=True,
message_history=message_history,
)

def send_message(
Expand Down

0 comments on commit cf46145

Please sign in to comment.