Skip to content

Commit

Permalink
comment message display code
Browse files Browse the repository at this point in the history
  • Loading branch information
evalstate committed Feb 14, 2025
1 parent 37c11c2 commit 5da25e5
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/mcp_agent/workflows/llm/augmented_llm_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from typing import Iterable, List, Type

from pydantic import BaseModel
from rich.panel import Panel

import instructor
from anthropic import Anthropic
Expand Down Expand Up @@ -175,26 +174,26 @@ async def generate(
tool_use_id = content.id

# TODO -- productionize this
if tool_name == HUMAN_INPUT_TOOL_NAME:
# Get the message from the content list
message_text = ""
for block in response_as_message["content"]:
if (
isinstance(block, dict)
and block.get("type") == "text"
):
message_text += block.get("text", "")
elif hasattr(block, "type") and block.type == "text":
message_text += block.text

panel = Panel(
message_text,
title="MESSAGE",
style="green",
border_style="bold white",
padding=(1, 2),
)
console.console.print(panel)
# if tool_name == HUMAN_INPUT_TOOL_NAME:
# # Get the message from the content list
# message_text = ""
# for block in response_as_message["content"]:
# if (
# isinstance(block, dict)
# and block.get("type") == "text"
# ):
# message_text += block.get("text", "")
# elif hasattr(block, "type") and block.type == "text":
# message_text += block.text

# panel = Panel(
# message_text,
# title="MESSAGE",
# style="green",
# border_style="bold white",
# padding=(1, 2),
# )
# console.console.print(panel)

tool_call_request = CallToolRequest(
method="tools/call",
Expand Down

0 comments on commit 5da25e5

Please sign in to comment.