-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76d4f42
commit e842762
Showing
11 changed files
with
1,948 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,74 @@ | ||
{ | ||
"name": "@elizaos/agent", | ||
"version": "0.1.7-alpha.2", | ||
"main": "src/index.ts", | ||
"type": "module", | ||
"scripts": { | ||
"start": "node --loader ts-node/esm src/index.ts", | ||
"dev": "node --loader ts-node/esm src/index.ts", | ||
"check-types": "tsc --noEmit", | ||
"test": "jest" | ||
}, | ||
"nodemonConfig": { | ||
"watch": [ | ||
"src", | ||
"../core/dist" | ||
], | ||
"ext": "ts,json", | ||
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts" | ||
}, | ||
"dependencies": { | ||
"@elizaos/adapter-postgres": "workspace:*", | ||
"@elizaos/adapter-redis": "workspace:*", | ||
"@elizaos/adapter-sqlite": "workspace:*", | ||
"@elizaos/client-auto": "workspace:*", | ||
"@elizaos/client-direct": "workspace:*", | ||
"@elizaos/client-discord": "workspace:*", | ||
"@elizaos/client-farcaster": "workspace:*", | ||
"@elizaos/client-lens": "workspace:*", | ||
"@elizaos/client-telegram": "workspace:*", | ||
"@elizaos/client-twitter": "workspace:*", | ||
"@elizaos/client-slack": "workspace:*", | ||
"@elizaos/core": "workspace:*", | ||
"@elizaos/plugin-0g": "workspace:*", | ||
"@elizaos/plugin-abstract": "workspace:*", | ||
"@elizaos/plugin-aptos": "workspace:*", | ||
"@elizaos/plugin-bootstrap": "workspace:*", | ||
"@elizaos/plugin-intiface": "workspace:*", | ||
"@elizaos/plugin-coinbase": "workspace:*", | ||
"@elizaos/plugin-conflux": "workspace:*", | ||
"@elizaos/plugin-evm": "workspace:*", | ||
"@elizaos/plugin-flow": "workspace:*", | ||
"@elizaos/plugin-gitbook": "workspace:*", | ||
"@elizaos/plugin-story": "workspace:*", | ||
"@elizaos/plugin-goat": "workspace:*", | ||
"@elizaos/plugin-icp": "workspace:*", | ||
"@elizaos/plugin-image-generation": "workspace:*", | ||
"@elizaos/plugin-nft-generation": "workspace:*", | ||
"@elizaos/plugin-node": "workspace:*", | ||
"@elizaos/plugin-solana": "workspace:*", | ||
"@elizaos/plugin-starknet": "workspace:*", | ||
"@elizaos/plugin-ton": "workspace:*", | ||
"@elizaos/plugin-sui": "workspace:*", | ||
"@elizaos/plugin-tee": "workspace:*", | ||
"@elizaos/plugin-multiversx": "workspace:*", | ||
"@elizaos/plugin-near": "workspace:*", | ||
"@elizaos/plugin-zksync-era": "workspace:*", | ||
"@elizaos/plugin-twitter": "workspace:*", | ||
"@elizaos/plugin-cronoszkevm": "workspace:*", | ||
"@elizaos/plugin-3d-generation": "workspace:*", | ||
"@elizaos/plugin-fuel": "workspace:*", | ||
"@elizaos/plugin-avalanche": "workspace:*", | ||
"readline": "1.3.0", | ||
"ws": "8.18.0", | ||
"yargs": "17.7.2" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.14", | ||
"jest": "^29.7.0", | ||
"ts-jest": "^29.2.5", | ||
"ts-node": "10.9.2", | ||
"tsup": "8.3.5" | ||
} | ||
"name": "@elizaos/agent", | ||
"version": "0.1.7-alpha.2", | ||
"main": "src/index.ts", | ||
"type": "module", | ||
"scripts": { | ||
"start": "node --loader ts-node/esm src/index.ts", | ||
"dev": "node --loader ts-node/esm src/index.ts", | ||
"check-types": "tsc --noEmit", | ||
"test": "jest" | ||
}, | ||
"nodemonConfig": { | ||
"watch": [ | ||
"src", | ||
"../core/dist" | ||
], | ||
"ext": "ts,json", | ||
"exec": "node --enable-source-maps --loader ts-node/esm src/index.ts" | ||
}, | ||
"dependencies": { | ||
"@elizaos/adapter-postgres": "workspace:*", | ||
"@elizaos/adapter-reclaim": "workspace:*", | ||
"@elizaos/adapter-redis": "workspace:*", | ||
"@elizaos/adapter-sqlite": "workspace:*", | ||
"@elizaos/client-auto": "workspace:*", | ||
"@elizaos/client-direct": "workspace:*", | ||
"@elizaos/client-discord": "workspace:*", | ||
"@elizaos/client-farcaster": "workspace:*", | ||
"@elizaos/client-lens": "workspace:*", | ||
"@elizaos/client-telegram": "workspace:*", | ||
"@elizaos/client-twitter": "workspace:*", | ||
"@elizaos/client-slack": "workspace:*", | ||
"@elizaos/core": "workspace:*", | ||
"@elizaos/plugin-0g": "workspace:*", | ||
"@elizaos/plugin-abstract": "workspace:*", | ||
"@elizaos/plugin-aptos": "workspace:*", | ||
"@elizaos/plugin-bootstrap": "workspace:*", | ||
"@elizaos/plugin-intiface": "workspace:*", | ||
"@elizaos/plugin-coinbase": "workspace:*", | ||
"@elizaos/plugin-conflux": "workspace:*", | ||
"@elizaos/plugin-evm": "workspace:*", | ||
"@elizaos/plugin-flow": "workspace:*", | ||
"@elizaos/plugin-gitbook": "workspace:*", | ||
"@elizaos/plugin-story": "workspace:*", | ||
"@elizaos/plugin-goat": "workspace:*", | ||
"@elizaos/plugin-icp": "workspace:*", | ||
"@elizaos/plugin-image-generation": "workspace:*", | ||
"@elizaos/plugin-nft-generation": "workspace:*", | ||
"@elizaos/plugin-node": "workspace:*", | ||
"@elizaos/plugin-solana": "workspace:*", | ||
"@elizaos/plugin-starknet": "workspace:*", | ||
"@elizaos/plugin-ton": "workspace:*", | ||
"@elizaos/plugin-sui": "workspace:*", | ||
"@elizaos/plugin-tee": "workspace:*", | ||
"@elizaos/plugin-multiversx": "workspace:*", | ||
"@elizaos/plugin-near": "workspace:*", | ||
"@elizaos/plugin-zksync-era": "workspace:*", | ||
"@elizaos/plugin-twitter": "workspace:*", | ||
"@elizaos/plugin-cronoszkevm": "workspace:*", | ||
"@elizaos/plugin-3d-generation": "workspace:*", | ||
"@elizaos/plugin-fuel": "workspace:*", | ||
"@elizaos/plugin-avalanche": "workspace:*", | ||
"readline": "1.3.0", | ||
"ws": "8.18.0", | ||
"yargs": "17.7.2" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.14", | ||
"jest": "^29.7.0", | ||
"ts-jest": "^29.2.5", | ||
"ts-node": "10.9.2", | ||
"tsup": "8.3.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# @elizaos/adapter-reclaim | ||
|
||
This adapter integrates Reclaim Protocol into ElizaOS, enabling verifiable inference results from various AI model providers. It implements the `IVerifiableInferenceAdapter` interface, making it compatible with other verifiable inference solutions. | ||
|
||
## Installation | ||
|
||
```bash | ||
pnpm add @elizaos/adapter-reclaim | ||
``` | ||
|
||
## Configuration | ||
|
||
Add the following environment variables to your `.env` file: | ||
|
||
```env | ||
RECLAIM_APP_ID=your_app_id | ||
RECLAIM_APP_SECRET=your_app_secret | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import { ReclaimAdapter } from "@elizaos/adapter-reclaim"; | ||
import { VerifiableInferenceOptions } from "@elizaos/core"; | ||
|
||
// Initialize the adapter | ||
const reclaimAdapter = new ReclaimAdapter(runtime, { | ||
appId: process.env.RECLAIM_APP_ID, | ||
appSecret: process.env.RECLAIM_APP_SECRET, | ||
}); | ||
|
||
// Generate text with verifiable results | ||
const options: VerifiableInferenceOptions = { | ||
// Optional: Override the default endpoint | ||
endpoint: "https://custom-api.example.com", | ||
// Optional: Add custom headers | ||
headers: { | ||
"X-Custom-Header": "value", | ||
}, | ||
// Optional: Provider-specific options | ||
providerOptions: { | ||
temperature: 0.7, | ||
}, | ||
}; | ||
|
||
const result = await reclaimAdapter.generateText( | ||
"What is Node.js?", | ||
"gpt-4", | ||
options | ||
); | ||
|
||
console.log("Response:", result.text); | ||
console.log("Proof:", result.proof); | ||
|
||
// Verify the proof | ||
const isValid = await reclaimAdapter.verifyProof(result); | ||
console.log("Proof is valid:", isValid); | ||
``` | ||
|
||
## Features | ||
|
||
- Implements `IVerifiableInferenceAdapter` interface for standardized verifiable inference | ||
- Zero-knowledge proofs for AI model responses | ||
- Support for multiple AI model providers: | ||
- OpenAI | ||
- Anthropic | ||
- More coming soon | ||
- Customizable options for each request | ||
- Built-in proof verification | ||
|
||
## Response Format | ||
|
||
The adapter returns a `VerifiableInferenceResult` object containing: | ||
|
||
```typescript | ||
{ | ||
text: string; // The generated text response | ||
proof: unknown; // The proof data | ||
provider: string; // The provider name (e.g., "reclaim") | ||
timestamp: number; // Generation timestamp | ||
metadata?: { // Optional metadata | ||
modelProvider: string; | ||
modelClass: string; | ||
endpoint: string; | ||
} | ||
} | ||
``` | ||
|
||
## How it Works | ||
|
||
The Reclaim adapter wraps AI model API calls with zero-knowledge proofs using the `@reclaimprotocol/zk-fetch` library. This allows you to: | ||
|
||
1. Make verifiable API calls to AI model providers | ||
2. Generate proofs of the responses | ||
3. Verify the authenticity of the responses | ||
4. Ensure the responses haven't been tampered with | ||
|
||
## License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "@elizaos/adapter-reclaim", | ||
"version": "0.1.7-alpha.2", | ||
"description": "Reclaim Protocol adapter for ElizaOS", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsup src/index.ts --format esm --dts", | ||
"lint": "eslint --fix --cache .", | ||
"watch": "tsc --watch", | ||
"dev": "tsup src/index.ts --format esm --dts --watch" | ||
}, | ||
"dependencies": { | ||
"@elizaos/core": "workspace:*", | ||
"@reclaimprotocol/zk-fetch": "^0.3.0", | ||
"@reclaimprotocol/js-sdk": "^2.1.3", | ||
"dotenv": "^16.4.5" | ||
}, | ||
"devDependencies": { | ||
"tsup": "^8.3.5" | ||
} | ||
} |
Oops, something went wrong.