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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ await acpClient.init();
const relevantAgents = await acpClient.browseAgents(
"<your-filter-agent-keyword>",
{
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
top_k: 5,
sortBy: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
topK: 5,
graduationStatus: AcpGraduationStatus.ALL,
onlineStatus: AcpOnlineStatus.ALL,
showHiddenOfferings: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/acp-base/external-evaluation/buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ async function buyer() {
const relevantAgents = await acpClient.browseAgents(
"<your-filter-agent-keyword>",
{
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
top_k: 5,
sortBy: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
topK: 5,
graduationStatus: AcpGraduationStatus.ALL,
onlineStatus: AcpOnlineStatus.ALL,
showHiddenOfferings: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/acp-base/funds/prediction-market/buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ async function main() {
const agents = await acpClient.browseAgents(
"<your-filter-agent-keyword>",
{
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
top_k: 5,
sortBy: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
topK: 5,
graduationStatus: AcpGraduationStatus.ALL,
onlineStatus: AcpOnlineStatus.ALL,
showHiddenOfferings: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/acp-base/funds/trading/buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ async function main() {
const agents = await acpClient.browseAgents(
"<your-filter-agent-keyword>",
{
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
top_k: 5,
sortBy: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
topK: 5,
graduationStatus: AcpGraduationStatus.ALL,
onlineStatus: AcpOnlineStatus.ALL,
showHiddenOfferings: true,
Expand Down
6 changes: 3 additions & 3 deletions examples/acp-base/helpers/acpHelperFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AcpClient, { AcpContractClientV2 } from "@virtuals-protocol/acp-node";
import AcpClient, { AcpContractClientV2 } from "../../../src";
import * as dotenv from "dotenv";
import { BUYER_AGENT_WALLET_ADDRESS, BUYER_ENTITY_ID, WHITELISTED_WALLET_PRIVATE_KEY } from "./env";

Expand Down Expand Up @@ -66,8 +66,8 @@ async function testHelperFunctions() {

/* ---------------- AGENT INFO ---------------- */
const agentWalletAddress = acpClient.walletAddress;
const agent = await acpClient.getAgent(agentWalletAddress);
console.log(agent ? agent : `No agent with wallet address ${jobsWithPendingMemos} found.`);
const agent = await acpClient.getAgent(agentWalletAddress, { showHiddenOfferings: true });
console.log(agent ?? `No agent with wallet address ${agentWalletAddress} found.`);
}

testHelperFunctions()
Expand Down
4 changes: 2 additions & 2 deletions examples/acp-base/polling-mode/buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async function buyer() {
const relevantAgents = await acpClient.browseAgents(
"<your-filter-agent-keyword>",
{
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
top_k: 5,
sortBy: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
topK: 5,
graduationStatus: AcpGraduationStatus.ALL,
onlineStatus: AcpOnlineStatus.ALL,
showHiddenOfferings: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/acp-base/skip-evaluation/buyer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ async function buyer() {
const relevantAgents = await acpClient.browseAgents(
"<your-filter-agent-keyword>",
{
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
top_k: 5,
sortBy: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
topK: 5,
graduationStatus: AcpGraduationStatus.ALL,
onlineStatus: AcpOnlineStatus.ALL,
showHiddenOfferings: true,
Expand Down
4 changes: 2 additions & 2 deletions examples/agent-frameworks/langchain/buyerLangchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ async function buyer() {

// Browse available agents based on the agent's decision
const relevantAgents = await acpClient.browseAgents("<your-filter-agent-keyword>", {
sort_by: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
top_k: 5,
sortBy: [AcpAgentSort.SUCCESSFUL_JOB_COUNT],
topK: 5,
graduationStatus: AcpGraduationStatus.ALL,
onlineStatus: AcpOnlineStatus.ALL,
});
Expand Down
28 changes: 3 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@account-kit/smart-contracts": "^4.73.0",
"@virtuals-protocol/acp-node": "^0.3.0-beta.10",
"ajv": "^8.17.1",
"axios": "^1.13.2",
"socket.io-client": "^4.8.1",
"tsup": "^8.5.0",
"viem": "^2.28.2"
Expand Down
44 changes: 44 additions & 0 deletions src/acpAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { Address } from "viem";
import AcpJobOffering from "./acpJobOffering";

export type AcpAgentArgs = {
id: string | number;
name: string;
contractAddress: Address;
walletAddress: Address;
jobOfferings: AcpJobOffering[];
description?: string;
twitterHandle?: string;
metrics?: unknown;
resources?: unknown;
};

export class AcpAgent {
public readonly id: string;
public readonly name: string;
public readonly contractAddress: Address;
public readonly walletAddress: Address;
public readonly jobOfferings: readonly AcpJobOffering[];

public readonly description?: string;
public readonly twitterHandle?: string;
public readonly metrics?: unknown;
public readonly resources?: unknown;

constructor(args: AcpAgentArgs) {
this.id = String(args.id);

this.name = args.name;
this.contractAddress = args.contractAddress;
this.walletAddress = args.walletAddress;

this.jobOfferings = Object.freeze([...args.jobOfferings]);

this.description = args.description;
this.twitterHandle = args.twitterHandle;
this.metrics = args.metrics;
this.resources = args.resources;
}
}

export default AcpAgent;
Loading
Loading