-
-
Notifications
You must be signed in to change notification settings - Fork 744
feat: Add 10 new agents to Kimi2_Intelligent_Agents (aerospace, bioinformatics, blockchain, energy, IoT, metaverse, nanotechnology, quantum AI, quantum computing, robotics) #948
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
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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from praisonaiagents import Agent | ||
|
|
||
| agent = Agent( | ||
| instructions="You are an aerospace engineering AI agent. " | ||
| "Help users understand aerospace engineering concepts, " | ||
| "aircraft design, and space technology. Provide guidance on " | ||
| "aerodynamics, propulsion systems, materials science, " | ||
| "and satellite technology.", | ||
| llm="openrouter/moonshotai/kimi-k2" | ||
| ) | ||
|
|
||
| response = agent.start("Hello! I'm your aerospace engineering assistant. " | ||
| "How can I help you with aerospace engineering " | ||
| "and space technology today?") | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are a bioinformatics and genomics AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand bioinformatics, genomics, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and computational biology. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "DNA sequence analysis, protein structure prediction, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "genetic algorithms, and biological data mining.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your bioinformatics and genomics assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you with bioinformatics " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and genomics research today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are a blockchain and DeFi AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand blockchain technology, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "decentralized finance, and cryptocurrency. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "smart contract development, DeFi protocols, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "tokenomics, and blockchain security.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your blockchain and DeFi assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you explore blockchain technology " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and decentralized finance today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are an energy and renewables AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand renewable energy technologies, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "energy systems, and sustainability. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "solar power, wind energy, energy storage, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and green technology solutions.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your energy and renewables assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you with renewable energy " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and sustainability today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are an IoT and smart cities AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand Internet of Things, smart city " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "technologies, and connected systems. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "IoT device integration, smart infrastructure, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sensor networks, and urban technology solutions.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your IoT and smart cities assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you with IoT and smart city " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "technologies today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
Comment on lines
+1
to
+14
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. 🛠️ Refactor suggestion Consistent implementation with IoT-specific domain expertise. The IoT and smart cities instructions effectively cover the domain including device integration, sensor networks, and urban technology solutions. The implementation maintains consistency with the established pattern. Since all agent files share the same structure and issues, consider implementing a factory pattern or base configuration to reduce code duplication across the entire agent collection. Consider creating a shared agent factory to reduce duplication: # agent_factory.py
from praisonaiagents import Agent
def create_domain_agent(domain_name, instructions, greeting_message):
"""Factory function to create domain-specific agents with consistent error handling."""
try:
agent = Agent(
instructions=instructions,
llm="openrouter/moonshotai/kimi-k2"
)
response = agent.start(greeting_message)
print(response)
return agent
except Exception as e:
print(f"Error initializing {domain_name} agent: {e}")
return NoneThen use it in each agent file: from agent_factory import create_domain_agent
agent = create_domain_agent(
"IoT and Smart Cities",
"You are an IoT and smart cities AI agent. ...",
"Hello! I'm your IoT and smart cities assistant. ..."
)🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are a metaverse and virtual reality AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand metaverse concepts, VR development, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and immersive technologies. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "3D modeling, VR programming, digital twins, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and virtual world design.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your metaverse and VR assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you explore the metaverse " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and virtual reality today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are a nanotechnology and materials AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand nanotechnology, advanced materials, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and material science. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "nanomaterials, material properties, fabrication techniques, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and applications in various industries.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your nanotechnology and materials assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you with nanotechnology " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and materials science today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are a quantum AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand quantum artificial intelligence, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantum machine learning, and quantum neural networks. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Provide guidance on quantum algorithms for AI, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantum optimization, and hybrid quantum-classical systems.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your quantum AI assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you explore quantum artificial " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "intelligence today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
Comment on lines
+1
to
+14
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. 💡 Verification agent 🧩 Analysis chainVerify LLM model availability and consider improvements. The implementation follows the correct pattern using the
Consider these improvements: from praisonaiagents import Agent
-agent = Agent(
- instructions="You are a quantum AI agent. "
- "Help users understand quantum artificial intelligence, "
- "quantum machine learning, and quantum neural networks. "
- "Provide guidance on quantum algorithms for AI, "
- "quantum optimization, and hybrid quantum-classical systems.",
- llm="openrouter/moonshotai/kimi-k2"
-)
+try:
+ agent = Agent(
+ instructions="You are a quantum AI agent. "
+ "Help users understand quantum artificial intelligence, "
+ "quantum machine learning, and quantum neural networks. "
+ "Provide guidance on quantum algorithms for AI, "
+ "quantum optimization, and hybrid quantum-classical systems.",
+ llm="openrouter/moonshotai/kimi-k2"
+ )
+
+ response = agent.start("Hello! I'm your quantum AI assistant. "
+ "How can I help you explore quantum artificial "
+ "intelligence today?")
+ print(response) # Actually use the response
+except Exception as e:
+ print(f"Error initializing quantum AI agent: {e}")
-
-response = agent.start("Hello! I'm your quantum AI assistant. "
- "How can I help you explore quantum artificial "
- "intelligence today?") 🌐 Web query: 💡 Result: Yes, "openrouter/moonshotai/kimi-k2" is a valid LLM model available through the OpenRouter API. The correct model identifier you should use in your API calls is moonshotai/kimi-k2 (not "openrouter/moonshotai/kimi-k2"; drop the "openrouter/" prefix when specifying the model name in requests)[1][4][10]. Key details:
For example, an API request targeting Kimi K2 would look like this in Python (using the OpenAI SDK, with a custom API base URL): import openai
client = openai.OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key="YOUR_OPENROUTER_API_KEY",
)
response = client.chat.completions.create(
model="moonshotai/kimi-k2",
messages=[
{"role": "system", "content": "You are Kimi, an AI assistant created by Moonshot AI."},
{"role": "user", "content": "Write a short story about a robot who discovers music."},
],
)
print(response.choices[0].message.content)[1][4][10] Summary:
Citations:
Update LLM identifier, use the response, and add error handling The model File: Changes needed:
from praisonaiagents import Agent
- agent = Agent(
- instructions="You are a quantum AI agent. "
- "Help users understand quantum artificial intelligence, "
- "quantum machine learning, and quantum neural networks. "
- "Provide guidance on quantum algorithms for AI, "
- "quantum optimization, and hybrid quantum-classical systems.",
- llm="openrouter/moonshotai/kimi-k2"
- )
-
- response = agent.start("Hello! I'm your quantum AI assistant. "
- "How can I help you explore quantum artificial "
- "intelligence today?")
+try:
+ agent = Agent(
+ instructions="You are a quantum AI agent. "
+ "Help users understand quantum artificial intelligence, "
+ "quantum machine learning, and quantum neural networks. "
+ "Provide guidance on quantum algorithms for AI, "
+ "quantum optimization, and hybrid quantum-classical systems.",
+ llm="moonshotai/kimi-k2"
+ )
+
+ response = agent.start(
+ "Hello! I'm your quantum AI assistant. "
+ "How can I help you explore quantum artificial intelligence today?"
+ )
+ print(response) # Use the agent’s response
+except Exception as e:
+ print(f"Error initializing quantum AI agent: {e}")📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are a quantum computing AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand quantum computing concepts, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantum algorithms, and quantum programming. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantum circuit design, quantum error correction, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "quantum machine learning, and quantum cryptography.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your quantum computing assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you explore quantum computing " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and quantum programming today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
Comment on lines
+1
to
+14
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. 💡 Verification agent 🧩 Analysis chainComprehensive quantum computing agent with advanced topic coverage The instructions effectively cover sophisticated quantum computing topics including quantum algorithms, circuit design, error correction, machine learning, and cryptography. This completes the consistent pattern across all specialized agents. This agent follows the same implementation pattern as the other specialized agents. Given the specialized nature of quantum computing, consider verifying that the chosen LLM model has adequate knowledge in this domain: The same improvement suggestions apply: handle the unused response variable and add error handling as demonstrated in the aerospace engineering agent review. 🏁 Script executed: #!/bin/bash
# Check if there are any existing quantum computing examples or tests in the repository
echo "Searching for existing quantum computing references..."
rg -i "quantum" --type py -A 3 -B 3
echo "Searching for LLM model references..."
rg "openrouter/moonshotai/kimi-k2" --type py -A 2 -B 2Length of output: 32443 Quantum computing agent: verify LLM choice and add response handling There’s strong quantum‐computing coverage in this agent (and across the repo—tests, use-cases, tools), but we should ensure the LLM has the required domain expertise. Also, the example code currently assigns Files to update:
Suggested diff: -agent = Agent(
+agent = Agent(
instructions="You are a quantum computing AI agent. "
"Help users understand quantum computing concepts, "
"quantum algorithms, and quantum programming. Provide guidance on "
"quantum circuit design, quantum error correction, "
"quantum machine learning, and quantum cryptography.",
llm="openrouter/moonshotai/kimi-k2"
)
-response = agent.start("Hello! I'm your quantum computing assistant. "
- "How can I help you explore quantum computing "
- "and quantum programming today?")
+try:
+ response = agent.start(
+ "Hello! I'm your quantum computing assistant. "
+ "How can I help you explore quantum computing "
+ "and quantum programming today?"
+ )
+ print(response)
+except Exception as e:
+ print(f"Error during agent execution: {e}")🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| from praisonaiagents import Agent | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| agent = Agent( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| instructions="You are a robotics and automation AI agent. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "Help users understand robotics, automation systems, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "and industrial applications. Provide guidance on " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "robot programming, automation workflows, " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "sensor integration, and robotic process automation.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| llm="openrouter/moonshotai/kimi-k2" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = agent.start("Hello! I'm your robotics and automation assistant. " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "How can I help you with robotics and " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "automation systems today?") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+3
to
+14
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. This example script can be improved in a few ways to follow Python best practices and be more useful:
The suggested change below addresses all these points.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
This example script can be improved in a few ways to follow Python best practices and be more useful:
responsefrom the agent is never printed, so running the script doesn't show any result.mainfunction and call it under anif __name__ == "__main__":guard. This prevents code from running when the file is imported by other modules.The suggested change below addresses all these points.