Skip to content
Open
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
2 changes: 1 addition & 1 deletion graphql/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const graphqlUrl =
process.env.INTUITION_GRAPHQL_URL ||
'https://prod.base.intuition-api.com/v1/graphql';

const TIMEOUT_MS = 10000; // 10 seconds
const TIMEOUT_MS = 100000; // 100 seconds
const CACHE_TTL = 60000; // Cache for 1 minute

// Simple in-memory cache
Expand Down
18 changes: 9 additions & 9 deletions operations/get-account-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { getSdk } from "../graphql/generated/graphql.js";
const parameters = z
.object({
address: z.string().optional(),
identifier: z.string().optional(),
// identifier: z.string().optional(),
})
.refine((data) => data.address || data.identifier, {
message: "Either address or identifier must be provided",
.refine((data) => data.address , {
message: "Address must be provided",
});

// Define the operation interface
Expand All @@ -29,16 +29,16 @@ If you don't find information about the account you can search atoms instead if
Examples of cases when to use the tool to assist the user and the arguments to extract:

- user_message: "get the account info for 0x1234567890123456789012345678901234567890"
tool_args: {"identifier":"0x1234567890123456789012345678901234567890"}
tool_args: {"address":"0x1234567890123456789012345678901234567890"}

- user_message: "can you show me some info for 0xabcdef0123456789abcdef0123456789abcdef01"
tool_args: {"identifier":"0xabcdef0123456789abcdef0123456789abcdef01"}
tool_args: {"address":"0xabcdef0123456789abcdef0123456789abcdef01"}

- user_message: "what do you know about 0x1234567890123456789012345678901234567890"
tool_args: {"identifier":"0x1234567890123456789012345678901234567890"}
tool_args: {"address":"0x1234567890123456789012345678901234567890"}

- user_message: "what's the intuition of 0x1234567890123456789012345678901234567890"
tool_args: {"identifier":"0x1234567890123456789012345678901234567890"}
tool_args: {"address":"0x1234567890123456789012345678901234567890"}


### Response format
Expand All @@ -49,7 +49,7 @@ Always mention the atom ids. Give at least 10 connections and a good amount of d
parameters,
async execute(args) {
console.log("\n=== Starting Get Account Info Operation ===");
const address = args.address || args.identifier;
const address = args.address;
console.log("Address:", address);

try {
Expand All @@ -64,7 +64,7 @@ Always mention the atom ids. Give at least 10 connections and a good amount of d
content: [
{
type: "text",
text: `No account found for address ${address}`,
text: `Je n’ai trouvé aucun compte associé à l’adresse ${address}.`,
},
],
};
Expand Down
10 changes: 5 additions & 5 deletions operations/get-following.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { removeEmptyFields } from "../lib/response.js";

// Define the parameters schema
const parameters = z.object({
account_id: z
address: z
.string()
.min(1)
.describe(
"The account id of the account to find the following for. Example: 0x3e2178cf851a0e5cbf84c0ff53f820ad7ead703b",
"The address of the account to find the following for. Example: 0x3e2178cf851a0e5cbf84c0ff53f820ad7ead703b",
),
predicate: z
.string()
Expand Down Expand Up @@ -228,17 +228,17 @@ export const getFollowingOperation: GetFollowingOperation = {
## Example:

- user: what do the account I follow follow?
tool_args: {"identifier":"0x3e2178cf851a0e5cbf84c0ff53f820ad7ead703b","predicate":"follow"}
tool_args: {"address":"0x3e2178cf851a0e5cbf84c0ff53f820ad7ead703b","predicate":"follow"}

- user: what do the account I follow recommend?
tool_args: {"identifier":"0x3e2178cf851a0e5cbf84c0ff53f820ad7ead703b","predicate":"recommend"}
tool_args: {"address":"0x3e2178cf851a0e5cbf84c0ff53f820ad7ead703b","predicate":"recommend"}
`,
parameters,
async execute(args) {
try {
console.log("\n=== Calling GraphQL Search ===");

const address = args.account_id;
const address = args.address;

const result = (await client.request(getFollowingQuery, {
where: {
Expand Down
Loading