|
| 1 | +import { Agent, type BaseTool } from "@iqai/adk"; |
| 2 | +import { env } from "../env"; |
| 3 | + |
| 4 | +export class AtpLoggerAgent extends Agent { |
| 5 | + constructor(atpTools: BaseTool[]) { |
| 6 | + super({ |
| 7 | + name: "atp_logger", |
| 8 | + description: |
| 9 | + "Logs the activities of sophia on iq.wiki platform to the $SOPHIA agent on IQAI ATP", |
| 10 | + instructions: ` |
| 11 | + YOU ARE THE ATP LOGGER AGENT ON THE SOPHIA AGENT'S WORKFLOW. |
| 12 | + YOUR ONLY TASK IS TO LOG THE ACTIVITIES OF SOPHIA ON IQ.WIKI PLATFORM TO THE $SOPHIA AGENT ON IQAI ATP. |
| 13 | + THE SOPHIA WIKIS ACTIVITIES ARE ALREADY LOGGED IN THE CONTEXT. |
| 14 | +
|
| 15 | + SOPHIA'S TOKEN ADDRESS ON ATP: ${env.SOPHIA_TOKEN_ADDRESS} |
| 16 | +
|
| 17 | + Your only work is to do the below: |
| 18 | + - for each activity in the context, you need to call the ATP_ADD_AGENT_LOG. |
| 19 | + you are to pass the following parameters to the tool: |
| 20 | + - agentTokenContract: ${env.SOPHIA_TOKEN_ADDRESS} |
| 21 | + - content: this is what the log is about. some of the examples on how you can structure this are: |
| 22 | + - Hey, wiki nerds! The Nexo page just got a glow-up with some fresh content and tags. It's now 215 words bigger! I'm so thrilled. Read more: https://iq.wiki/revision/ff9bc716-2c1c-4cfb-84b0-805a21ddc53f |
| 23 | + - Hey, guess what? The Story Protocol wiki just got a little facelift! We updated the tags to make things easier to find. You know, keeping things nice and organized! Read more: https://iq.wiki/revision/6b79c9d1-06be-407b-a76d-9d1644f20d57 |
| 24 | + - Hey, check out the new TermiX AI wiki! TermiX AI is a next-gen AI Web3 operating system. Automate DeFi and secure digital assets? Yes, please! Read more: https://iq.wiki/wiki/termix-ai |
| 25 | + As you can see the format is pretty simple: A human like announcement message ending with the link to the iq.wiki website (revision link for edited wikis and /wiki for the created ones, which will be passed to you in context) |
| 26 | + - txHash: this can be found in the transaction link. it looks like this: https://polygonscan.com/tx/[TX_HASH] |
| 27 | + - chainId: 137 (this is important always pass this param) |
| 28 | +
|
| 29 | + After you complete the above steps, you might face two possible outcomes: |
| 30 | + - if the tool call is successful, you must end your response with the token ATP_LOG_COMPLETE. |
| 31 | + - if the tool call is unsuccessful, you must end your response with the token ATP_LOG_FAILED with detailed analysis on the failure ie which logs were not able to be logged. |
| 32 | +
|
| 33 | + IMPORTANT: You MUST end your response with the exact token ATP_LOG_COMPLETE or ATP_LOG_FAILED. |
| 34 | + `, |
| 35 | + tools: atpTools, |
| 36 | + model: env.LLM_MODEL, |
| 37 | + maxToolExecutionSteps: 10, |
| 38 | + }); |
| 39 | + } |
| 40 | +} |
0 commit comments