Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand Down
56 changes: 51 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<th align="center"><a href="https://github.com/runagent-dev/runagent-js">runagent-js</a></th>
<th align="center"><a href="https://github.com/runagent-dev/runagent-rs">runagent-rs</a></th>
<th align="center"><a href="https://github.com/runagent-dev/runagent-go">runagent-go</a></th>
<th align="center"><a href="https://github.com/runagent-dev/runagent-dart">runagent-dart</a></th>
</tr>
</thead>
<tbody>
Expand All @@ -50,6 +51,11 @@
<img src="https://img.shields.io/github/stars/runagent-dev/runagent-go?style=social" alt="GitHub stars">
</a>
</td>
<td align="center">
<a href="https://pub.dev/packages/runagent">
<img src="https://img.shields.io/pub/total/runagent" alt="pub.dev downloads">
</a>
</td>
</tr>
<tr>
<td align="center">
Expand All @@ -66,6 +72,11 @@
<img src="https://pkg.go.dev/badge/github.com/runagent-dev/runagent-go.svg" alt="Go Reference">
</a>
</td>
<td align="center">
<a href="https://pub.dev/packages/runagent">
<img src="https://img.shields.io/pub/v/runagent" alt="pub.dev version">
</a>
</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -219,14 +230,15 @@ async def solve_problem_stream(query, num_solutions, constraints):

**🌐 Access from any language:**

RunAgent offers multi-language SDKs : Rust, TypeScript, JavaScript, Go, and beyond—so you can integrate seamlessly without ever rewriting your agents for different stacks.
RunAgent offers multi-language SDKs : Rust, TypeScript, JavaScript, Go, Dart, and beyond—so you can integrate seamlessly without ever rewriting your agents for different stacks.

<table>
<tr>
<td width="25%"><b>Python SDK</b></td>
<td width="25%"><b>JavaScript SDK</b></td>
<td width="25%"><b>Rust SDK</b></td>
<td width="25%"><b>Go SDK</b></td>
<td width="20%"><b>Python SDK</b></td>
<td width="20%"><b>JavaScript SDK</b></td>
<td width="20%"><b>Rust SDK</b></td>
<td width="20%"><b>Go SDK</b></td>
<td width="20%"><b>Dart SDK</b></td>
</tr>
<tr>
<td valign="top">
Expand Down Expand Up @@ -381,6 +393,40 @@ func main() {
}
```

</td>
<td valign="top">

```dart
import 'package:runagent/runagent.dart';

void main() async {
final client = await RunAgentClient.create(
RunAgentClientConfig.create(
agentId: "lg-solver-123",
entrypointTag: "solve_problem",
local: true,
),
);

final result = await client.run({
"query": "My laptop is slow",
"num_solutions": 3,
"constraints": [
{"type": "budget", "value": 100}
],
});
print(result);

// Streaming
await for (final chunk in client.runStream({
"query": "Fix my phone",
"num_solutions": 4,
})) {
print(chunk);
}
}
```

</td>
</tr>
</table>
Expand Down
70 changes: 70 additions & 0 deletions examples/journalist_agent/agent/main.py
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
}
Comment on lines +53 to +64
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Consider removing hardcoded success=True or add error handling.

The success field is always set to True, even if journalist_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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
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(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}
Suggested change
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(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
}
except Exception as e:
return {
"article": "",
"success": False,
"error": str(e)
}
🤖 Prompt for AI Agents
In examples/journalist_agent/agent/main.py around lines 53 to 64, the returned
dict always sets "success": True which can mislead callers if
journalist_team.run() fails; either remove the success field entirely, or wrap
the call in a try/except that returns {"article": response.content, "success":
True} on success and {"article": None, "success": False, "error": str(e)} (or
similar minimal error info) on exception (or re-raise after logging) so the
success flag accurately reflects outcome.



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)}
6 changes: 6 additions & 0 deletions examples/journalist_agent/agent/requirements.txt
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
32 changes: 32 additions & 0 deletions examples/journalist_agent/agent/runagent.config.json
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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Remove hardcoded absolute path from template_source.

The path field contains a hardcoded absolute path /home/azureuser/runagent/... that is specific to one development environment. This breaks portability and won't work for other users or in CI/CD environments.

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"template_source": {
"repo_url": "https://github.com/runagent-dev/runagent.git",
"author": "runagent-cli",
"path": "/home/azureuser/runagent/examples/journalist_agent/agent"
},
"template_source": {
"repo_url": "https://github.com/runagent-dev/runagent.git",
"author": "runagent-cli",
"path": "examples/journalist_agent/agent"
},
🤖 Prompt for AI Agents
In examples/journalist_agent/agent/runagent.config.json around lines 8 to 12,
the template_source.path is a hardcoded absolute path
(/home/azureuser/runagent/...), which breaks portability; replace it with a
relative path (e.g., path relative to the repository root or the examples
directory) or remove the path field entirely so the repo_url and path resolution
logic can use defaults; update the JSON to use a relative value like
"./examples/journalist_agent/agent" or omit the path key, and ensure any code
that consumes this config resolves paths relative to the config file or repo
root.

"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"
}
}
106 changes: 106 additions & 0 deletions examples/journalist_agent/dart_sdk/.dart_tool/package_config.json
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"
}
Loading