Skip to content

Building AI agents, atomically

Linting

KennyVaneetvelde56a2940923ce
diff --git a/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py b/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py
index fa7e0d6..9b77be2 100644
--- a/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py
+++ b/atomic-examples/quickstart/quickstart/1_1_basic_chatbot_streaming.py
@@ -49,6 +49,7 @@ console.print(Panel(default_system_prompt, width=console.width, style="bold cyan
console.print(Text("Agent:", style="bold green"), end=" ")
console.print(Text(initial_message.chat_message, style="green"))
+
async def main():
# Start an infinite loop to handle user inputs and agent responses
while True:
@@ -72,12 +73,11 @@ async def main():
if partial_response.chat_message != current_response:
current_response = partial_response.chat_message
# Combine the label and response in the live display
- display_text = Text.assemble(
- (f"Agent: ", "bold green"),
- (current_response, "green")
- )
+ display_text = Text.assemble(("Agent: ", "bold green"), (current_response, "green"))
live.update(display_text)
+
if __name__ == "__main__":
import asyncio
+
asyncio.run(main())
diff --git a/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py b/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py
index 7896ae2..2eeae2c 100644
--- a/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py
+++ b/atomic-examples/quickstart/quickstart/3_1_basic_custom_chatbot_with_custom_schema_streaming.py
@@ -93,6 +93,7 @@ for i, question in enumerate(initial_message.suggested_user_questions, 1):
console.print(f"[cyan]{i}. {question}[/cyan]")
console.print() # Add an empty line for better readability
+
async def main():
# Start an infinite loop to handle user inputs and agent responses
while True:
@@ -123,10 +124,7 @@ async def main():
current_questions = partial_response.suggested_user_questions
# Combine all elements for display
- display_text = Text.assemble(
- (f"Agent: ", "bold green"),
- (current_response, "green")
- )
+ display_text = Text.assemble(("Agent: ", "bold green"), (current_response, "green"))
# Add questions if we have them
if current_questions:
@@ -139,6 +137,8 @@ async def main():
console.print() # Add an empty line for better readability
+
if __name__ == "__main__":
import asyncio
+
asyncio.run(main())