brainsqueeze commited on
Commit
9b01c12
·
verified ·
1 Parent(s): f5c9c80

LLM update + copy changes

Browse files

* update to Claude sonnet-4.5
* remove copy button on all messages

Files changed (1) hide show
  1. chat_v2.py +5 -5
chat_v2.py CHANGED
@@ -40,7 +40,7 @@ class LoggedComponents(TypedDict):
40
  def build_execution_graph() -> CompiledStateGraph:
41
  llm = ChatBedrock(
42
  client=boto3.client("bedrock-runtime", region_name="us-east-1"),
43
- model=BedrockEndpoints.claude_35_haiku.value
44
  )
45
  org_name_recognition = OrganizationIdentifier(llm=llm) # bind the main chat model to the tool
46
  return create_react_agent(
@@ -60,7 +60,7 @@ def generate_postscript_messages(history: list[gr.ChatMessage]) -> Iterator[gr.C
60
  if title == search_candid_knowledge_base.name:
61
  yield gr.ChatMessage(
62
  role="assistant",
63
- content=html_format_docs_chat(record.metadata.get("documents")),
64
  metadata={
65
  "title": "Source citations",
66
  }
@@ -168,7 +168,8 @@ def build_chat_app():
168
  height="60vh",
169
  type="messages",
170
  show_label=False,
171
- show_copy_button=True,
 
172
  autoscroll=True,
173
  layout="panel",
174
  )
@@ -236,7 +237,7 @@ def build_app():
236
  with open(os.path.join(ROOT, "static", "chatStyle.css"), "r", encoding="utf8") as f:
237
  css_chat = f.read()
238
 
239
- demo = gr.TabbedInterface(
240
  interface_list=[
241
  candid_chat,
242
  feedback
@@ -249,7 +250,6 @@ def build_app():
249
  theme=gr.themes.Soft(),
250
  css=css_chat,
251
  )
252
- return demo
253
 
254
 
255
  if __name__ == "__main__":
 
40
  def build_execution_graph() -> CompiledStateGraph:
41
  llm = ChatBedrock(
42
  client=boto3.client("bedrock-runtime", region_name="us-east-1"),
43
+ model=BedrockEndpoints.claude_45_sonnet.value,
44
  )
45
  org_name_recognition = OrganizationIdentifier(llm=llm) # bind the main chat model to the tool
46
  return create_react_agent(
 
60
  if title == search_candid_knowledge_base.name:
61
  yield gr.ChatMessage(
62
  role="assistant",
63
+ content=html_format_docs_chat(record.metadata.get("documents") or []),
64
  metadata={
65
  "title": "Source citations",
66
  }
 
168
  height="60vh",
169
  type="messages",
170
  show_label=False,
171
+ # show_copy_button=True,
172
+ show_copy_all_button=True,
173
  autoscroll=True,
174
  layout="panel",
175
  )
 
237
  with open(os.path.join(ROOT, "static", "chatStyle.css"), "r", encoding="utf8") as f:
238
  css_chat = f.read()
239
 
240
+ return gr.TabbedInterface(
241
  interface_list=[
242
  candid_chat,
243
  feedback
 
250
  theme=gr.themes.Soft(),
251
  css=css_chat,
252
  )
 
253
 
254
 
255
  if __name__ == "__main__":