Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions 25_11_29_00_46-conversation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "good evening"
}
],
"is_template": false
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": " Good evening! I can see you're in the fast-agent workspace. How can I help you with your project today?"
}
],
"channels": {
"reasoning": [
{
"type": "text",
"text": " The user is greeting me with \"good evening\". This is a simple, friendly greeting. I should respond in a polite and friendly manner. Since the current date is29 November2025, and they've provided their environment details, but no specific question yet, I should acknowledge their greeting and see if they need help with anything related to their workspace.\n\nI should be helpful, concise, and inviting. I can mention that I see they're working in the fast-agent project and ask how I can assist them.\n\nLet me craft a response:\n1. Return the greeting2. Acknowledge the workspace context3. Offer assistance with their projectI'll keep it brief and friendly."
}
],
"fast-agent-timing": [
{
"type": "text",
"text": "{\"start_time\": 18376.310372205, \"end_time\": 18378.574599238, \"duration_ms\": 2264.23}"
}
]
},
"stop_reason": "endTurn",
"is_template": false
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "tell me a joke first"
}
],
"is_template": false
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": " Why don't programmers like nature? Because it has too many bugs."
}
],
"channels": {
"reasoning": [
{
"type": "text",
"text": " The user is asking me to tell a joke first. This is a simple request that doesn't require any coding or workspace analysis. I should just tell a joke to be friendly and engaging.\n\nLet me think of a good joke. Something light, maybe tech-related or just a classic. Here's one I like:\n\n\"Why don't programmers like nature? Because it has too many bugs.\"\n\nThat's short, relevant to the environment (since we're in a coding workspace), and hopefully amusing.\n\nI'll keep it simple and direct."
}
],
"fast-agent-timing": [
{
"type": "text",
"text": "{\"start_time\": 18385.142788299, \"end_time\": 18387.088651998, \"duration_ms\": 1945.86}"
}
]
},
"stop_reason": "endTurn",
"is_template": false
},
{
"role": "user",
"content": [
{
"type": "text",
"text": "oh that's a good one"
}
],
"is_template": false
},
{
"role": "assistant",
"content": [
{
"type": "text",
"text": " Glad you liked it! Now, what can I help you with in the fast-agent workspace today?"
}
],
"channels": {
"reasoning": [
{
"type": "text",
"text": " The user appreciated my programming joke. They're working in a fast-agent workspace, so they're likely a developer or working on an AI/agent project. The interaction has been light and friendly so far. I should continue being helpful and professional while maintaining the casual tone they've established.\n\nSince they haven't asked a specific question yet about their project, I should prompt them to see what they need help with regarding fast-agent, but keep it conversational.\n\nLet me respond in a friendly way that acknowledges their appreciation and then gently guides toward their actual needs."
}
],
"fast-agent-timing": [
{
"type": "text",
"text": "{\"start_time\": 18396.146121747, \"end_time\": 18397.816729773, \"duration_ms\": 1670.61}"
}
]
},
"stop_reason": "endTurn",
"is_template": false
}
]
}
13 changes: 8 additions & 5 deletions examples/new-api/textual_markdown_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from mcp.types import CallToolResult

from fast_agent.interfaces import AgentProtocol
from fast_agent.llm.stream_types import StreamChunk

DEFAULT_PROMPT = (
"Provide a short markdown summary with a heading and bullet list describing how "
Expand Down Expand Up @@ -518,11 +519,11 @@ async def _generate_and_render(self) -> None:
self._set_status("Error")
return

queue: asyncio.Queue[str] = asyncio.Queue()
queue: asyncio.Queue[StreamChunk] = asyncio.Queue()
response_text: str | None = None
received_stream_chunks = False

def on_chunk(chunk: str) -> None:
def on_chunk(chunk: StreamChunk) -> None:
queue.put_nowait(chunk)

def remove_listener():
Expand All @@ -542,10 +543,10 @@ def remove_listener():
chunk = await asyncio.wait_for(queue.get(), timeout=0.1)
except asyncio.TimeoutError:
continue
if not chunk:
if not chunk or not chunk.text:
continue
message = self._ensure_assistant_message()
message.content += chunk
message.content += chunk.text
self._refresh_chat()
received_stream_chunks = True

Expand Down Expand Up @@ -729,7 +730,9 @@ def handle_display_tool_call(

self._active_assistant_message = None

right_info = "shell command" if metadata.get("variant") == "shell" else f"tool request - {tool_name}"
right_info = (
"shell command" if metadata.get("variant") == "shell" else f"tool request - {tool_name}"
)

message = ChatMessage(
role="tool_call",
Expand Down
5 changes: 4 additions & 1 deletion examples/setup/fastagent.config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FastAgent Configuration File
# fast-agent configuration File

# Default Model Configuration:
#
Expand All @@ -15,6 +15,9 @@ default_model: gpt-5-mini.low
# Number of times to retry transient LLM API errors (falls back to FAST_AGENT_RETRIES env var)
# llm_retries: 0

# otel:
# enabled: true

# mcp-ui support: disabled, enabled or auto. "auto" opens the web browser on the asset automatically
# mcp_ui_output_dir: ".fast-agent/ui" # Where to write MCP-UI HTML files (relative to CWD if not absolute)
# mcp_ui_mode: enabled
Expand Down
4 changes: 3 additions & 1 deletion fastagent.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ default_model: gpt-5-mini.low
# mcp_ui_output_dir: ".fast-agent/ui" # Where to write MCP-UI HTML files (relative to CWD if not absolute)
# mcp_ui_mode: enabled

# otel:
# enabled: true

# Logging and Console Configuration:
logger:
# level: "debug" | "info" | "warning" | "error"
Expand Down Expand Up @@ -48,4 +51,3 @@ mcp:
url: "http://localhost:3001/mcp"
elicitation:
mode: "auto-cancel"

15 changes: 15 additions & 0 deletions foo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# The Moon Landing: Humanity's Greatest Leap

On July 20, 1969, at 20:17 UTC, the Apollo 11 Lunar Module "Eagle" touched down on the Moon's Sea of Tranquility, marking the culmination of one of humanity's most ambitious endeavors. Six and a half hours later, Neil Armstrong descended the ladder and became the first human to set foot on another celestial body, uttering the immortal words: "That's one small step for man, one giant leap for mankind."

The journey to this moment had begun eight years earlier, when President John F. Kennedy challenged the nation to land a man on the Moon and return him safely to Earth before the decade's end. This audacious goal came at the height of the Cold War space race, when Soviet achievements had put American prestige at stake. The Apollo program would eventually cost $25.4 billion (equivalent to over $150 billion today) and involve over 400,000 engineers, scientists, and technicians.

The Apollo 11 crew consisted of commander Neil Armstrong, lunar module pilot Buzz Aldrin, and command module pilot Michael Collins. While Armstrong and Aldrin descended to the lunar surface, Collins remained in orbit around the Moon, alone in Columbia, maintaining the vital link back to Earth. Many have called Collins "the loneliest man in the universe" during those 21 hours, though he never expressed regret about his role.

The landing itself was nearly aborted. As Eagle approached the surface, Armstrong realized the automated landing system was guiding them toward a boulder-strewn crater the size of a football field. With fuel running critically low, he took manual control and skillfully piloted the spacecraft to a safe landing site with just 25 seconds of fuel remaining.

The astronauts spent approximately two and a half hours outside the lunar module, collecting 47.5 pounds of lunar samples, planting an American flag, and deploying scientific instruments including a laser reflector still used today to measure the Earth-Moon distance. They left behind a plaque reading: "Here Men From The Planet Earth First Set Foot Upon The Moon, July 1969 A.D. We Came In Peace For All Mankind."

The significance of the Moon landing extends far beyond the technical achievement. It represented humanity's ability to achieve the seemingly impossible through collective effort, scientific rigor, and sheer determination. The famous "Earthrise" photograph taken on Apollo 8 had already shown us our fragile planet from space, but walking on the Moon made us truly citizens of the cosmos.

Today, more than 50 years later, the Apollo 11 mission remains a defining moment in human history. As we stand on the brink of new lunar exploration with the Artemis program and contemplate missions to Mars, we look back on that summer night in 1969 as proof that when humanity dares to dream big, we can indeed touch the stars.
Loading
Loading