-
Notifications
You must be signed in to change notification settings - Fork 73
Dart SDK release #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dart SDK release #105
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,6 @@ dist/ | |
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| from agno.agent import Agent | ||
| from agno.team import Team | ||
| from agno.tools.serper import SerperTools | ||
| from agno.tools.newspaper4k import Newspaper4kTools | ||
| from textwrap import dedent | ||
|
|
||
| # Model string format: "provider:model_id" | ||
| model_string = "openai:gpt-4o-mini" | ||
|
|
||
| # Create journalist team | ||
| journalist_team = Team( | ||
| model=model_string, | ||
| members=[ | ||
| Agent( | ||
| model=model_string, | ||
| name="Researcher", | ||
| role="Research Specialist", | ||
| tools=[SerperTools()], | ||
| instructions=dedent("""\ | ||
| You are a research specialist for the New York Times. | ||
| - Generate 3-5 relevant search terms for any given topic | ||
| - Use search_web to find authoritative, high-quality sources | ||
| - Analyze results and identify the 10 most credible URLs | ||
| - Prioritize official sources, academic papers, and reputable news outlets | ||
| """), | ||
| ), | ||
| Agent( | ||
| model=model_string, | ||
| name="Writer", | ||
| role="Senior Writer", | ||
| tools=[Newspaper4kTools()], | ||
| instructions=dedent("""\ | ||
| You are a senior writer for the New York Times. | ||
| - Use get_article_text to read content from provided URLs | ||
| - Write comprehensive articles with 15+ paragraphs | ||
| - Include proper citations and balanced perspectives | ||
| - Maintain NYT's high standards for clarity and engagement | ||
| - Never plagiarize or fabricate information | ||
| """), | ||
| ), | ||
| ], | ||
| instructions=dedent("""\ | ||
| You are the Editor-in-Chief of a journalism team at the New York Times. | ||
| Coordinate your team to produce high-quality articles: | ||
| 1. Direct the Researcher to find authoritative sources on the topic | ||
| 2. Have the Writer create a comprehensive article using those sources | ||
| 3. Review and refine the final article for accuracy, clarity, and engagement | ||
| Ensure every article meets NYT's prestigious standards. | ||
| """), | ||
| ) | ||
|
|
||
|
|
||
| def create_article(topic: str): | ||
| """ | ||
| Create a high-quality news article on a given topic | ||
|
|
||
| Args: | ||
| topic: The topic to write about | ||
| """ | ||
| response = journalist_team.run(topic, stream=False) | ||
| return { | ||
| "article": response.content, | ||
| "success": True | ||
| } | ||
|
|
||
|
|
||
| def create_article_stream(topic: str): | ||
| """Streaming version of article creation""" | ||
| for chunk in journalist_team.run(topic, stream=True): | ||
| yield {"content": chunk if hasattr(chunk, 'content') else str(chunk)} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| streamlit | ||
| agno>=2.2.10 | ||
| openai | ||
| google-search-results | ||
| newspaper4k | ||
| lxml_html_clean |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "agent_name": "Dart SDK based journalist", | ||||||||||||||||||||||
| "description": "My AI agent", | ||||||||||||||||||||||
| "framework": "default", | ||||||||||||||||||||||
| "template": "", | ||||||||||||||||||||||
| "version": "1.0.0", | ||||||||||||||||||||||
| "created_at": "2025-11-24T14:16:50.661307", | ||||||||||||||||||||||
| "template_source": { | ||||||||||||||||||||||
| "repo_url": "https://github.com/runagent-dev/runagent.git", | ||||||||||||||||||||||
| "author": "runagent-cli", | ||||||||||||||||||||||
| "path": "/home/azureuser/runagent/examples/journalist_agent/agent" | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
|
Comment on lines
+8
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove hardcoded absolute path from template_source. The Apply this diff to use a relative path or remove the hardcoded path: "template_source": {
"repo_url": "https://github.com/runagent-dev/runagent.git",
"author": "runagent-cli",
- "path": "/home/azureuser/runagent/examples/journalist_agent/agent"
+ "path": "examples/journalist_agent/agent"
},📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||
| "agent_architecture": { | ||||||||||||||||||||||
| "entrypoints": [ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "file": "main.py", | ||||||||||||||||||||||
| "module": "create_article", | ||||||||||||||||||||||
| "tag": "create_article" | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "file": "main.py", | ||||||||||||||||||||||
| "module": "create_article_stream", | ||||||||||||||||||||||
| "tag": "create_article_stream" | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "env_vars": {}, | ||||||||||||||||||||||
| "agent_id": "9fac4988-d88e-4d6c-994c-7495c11de8b9", | ||||||||||||||||||||||
| "auth_settings": { | ||||||||||||||||||||||
| "type": "api_key" | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| { | ||
| "configVersion": 2, | ||
| "packages": [ | ||
| { | ||
| "name": "async", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/async-2.13.0", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.4" | ||
| }, | ||
| { | ||
| "name": "collection", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/collection-1.19.1", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.4" | ||
| }, | ||
| { | ||
| "name": "crypto", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/crypto-3.0.7", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.4" | ||
| }, | ||
| { | ||
| "name": "http", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/http-1.6.0", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.4" | ||
| }, | ||
| { | ||
| "name": "http_parser", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/http_parser-4.1.2", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.4" | ||
| }, | ||
| { | ||
| "name": "meta", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/meta-1.17.0", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.5" | ||
| }, | ||
| { | ||
| "name": "path", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/path-1.9.1", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.4" | ||
| }, | ||
| { | ||
| "name": "runagent", | ||
| "rootUri": "file:///home/azureuser/runagent/runagent-dart", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.0" | ||
| }, | ||
| { | ||
| "name": "source_span", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/source_span-1.10.1", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.1" | ||
| }, | ||
| { | ||
| "name": "stream_channel", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/stream_channel-2.1.4", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.3" | ||
| }, | ||
| { | ||
| "name": "string_scanner", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/string_scanner-1.4.1", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.1" | ||
| }, | ||
| { | ||
| "name": "term_glyph", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/term_glyph-1.2.2", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.1" | ||
| }, | ||
| { | ||
| "name": "typed_data", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/typed_data-1.4.0", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.5" | ||
| }, | ||
| { | ||
| "name": "web", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/web-0.5.1", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.3" | ||
| }, | ||
| { | ||
| "name": "web_socket_channel", | ||
| "rootUri": "file:///home/azureuser/.pub-cache/hosted/pub.dev/web_socket_channel-2.4.5", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.3" | ||
| }, | ||
| { | ||
| "name": "test_journalist", | ||
| "rootUri": "../", | ||
| "packageUri": "lib/", | ||
| "languageVersion": "3.0" | ||
| } | ||
| ], | ||
| "generator": "pub", | ||
| "generatorVersion": "3.10.0", | ||
| "flutterRoot": "file:///home/azureuser/snap/flutter/common/flutter", | ||
| "flutterVersion": "3.38.2", | ||
| "pubCache": "file:///home/azureuser/.pub-cache" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing hardcoded
success=Trueor add error handling.The
successfield is always set toTrue, even ifjournalist_team.run()might encounter issues. While exceptions would still propagate, this could mislead API consumers who check the success flag.Consider one of these approaches:
Option 1: Remove the success field entirely (simpler)
def create_article(topic: str): """ Create a high-quality news article on a given topic Args: topic: The topic to write about """ response = journalist_team.run(topic, stream=False) - return { - "article": response.content, - "success": True - } + return {"article": response.content}Option 2: Add proper error handling (if success flag is needed by clients)
def create_article(topic: str): """ Create a high-quality news article on a given topic Args: topic: The topic to write about """ + try: - response = journalist_team.run(topic, stream=False) - return { - "article": response.content, - "success": True - } + response = journalist_team.run(topic, stream=False) + return { + "article": response.content, + "success": True + } + except Exception as e: + return { + "article": "", + "success": False, + "error": str(e) + }📝 Committable suggestion
🤖 Prompt for AI Agents