Skip to content

Commit e4ea9f3

Browse files
committed
feat: add ai powered search to propose a value to a request
1 parent 6d5dd90 commit e4ea9f3

File tree

7 files changed

+985
-29
lines changed

7 files changed

+985
-29
lines changed

packages/r/intermarch3/goo-cli/README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Command-line interface for the Gno Optimistic Oracle (GOO).
66

77
- **Request Management**: Create data requests with custom parameters (auto-queries default reward)
88
- **Value Proposals**: Propose values for pending requests (auto-queries and sends required bond)
9+
- **AI-Powered Proposals**: Automatically research and propose values using Google Gemini AI with web search
910
- **Dispute System**: Challenge proposed values and participate in voting (auto-queries and sends required bond)
1011
- **Voting Mechanism**: Commit-reveal voting with local vote storage (auto-queries vote token price)
1112
- **Query Operations**: Read oracle state and parameters
@@ -44,6 +45,7 @@ chain_id: test4
4445
remote: https://rpc.test4.gno.land:443
4546
gas_fee: 1000000ugnot
4647
gas_wanted: 2000000
48+
google_api_key: "" # Optional: for AI-powered proposals
4749
```
4850
4951
View current configuration:
@@ -94,11 +96,16 @@ goo request retrieve-fund 0000001
9496

9597
### Propose Commands
9698

97-
**Propose a value:**
99+
**Propose a value (manual):**
98100
```bash
99101
goo propose value 0000001 3500
100102
```
101103

104+
**Propose a value (AI-powered with web search):**
105+
```bash
106+
goo propose value 0000001 --search
107+
```
108+
102109
**Resolve a non-disputed request:**
103110
```bash
104111
goo propose resolve 0000001
@@ -199,9 +206,13 @@ goo admin change-admin g1abcdef...
199206
goo request create --question "ETH/USD?" --deadline "2025-10-28T12:00:00Z"
200207
```
201208

202-
3. **Propose a value:**
209+
3. **Propose a value (manual or AI-powered):**
203210
```bash
211+
# Manual
204212
goo propose value 0000001 3500
213+
214+
# Or let AI research it
215+
goo propose value 0000001 --search
205216
```
206217

207218
4. **Someone disputes (if they disagree):**

packages/r/intermarch3/goo-cli/go.mod

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,29 @@ module goo-cli
33
go 1.21
44

55
require (
6+
github.com/google/generative-ai-go v0.18.0
67
github.com/spf13/cobra v1.8.0
78
github.com/spf13/viper v1.18.2
9+
google.golang.org/api v0.203.0
810
gopkg.in/yaml.v3 v3.0.1
911
)
1012

1113
require (
14+
cloud.google.com/go v0.116.0 // indirect
15+
cloud.google.com/go/ai v0.8.0 // indirect
16+
cloud.google.com/go/auth v0.9.9 // indirect
17+
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
18+
cloud.google.com/go/compute/metadata v0.5.2 // indirect
19+
cloud.google.com/go/longrunning v0.5.7 // indirect
20+
github.com/felixge/httpsnoop v1.0.4 // indirect
1221
github.com/fsnotify/fsnotify v1.7.0 // indirect
22+
github.com/go-logr/logr v1.4.2 // indirect
23+
github.com/go-logr/stdr v1.2.2 // indirect
24+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
25+
github.com/google/s2a-go v0.1.8 // indirect
26+
github.com/google/uuid v1.6.0 // indirect
27+
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
28+
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
1329
github.com/hashicorp/hcl v1.0.0 // indirect
1430
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1531
github.com/magiconair/properties v1.8.7 // indirect
@@ -22,10 +38,25 @@ require (
2238
github.com/spf13/cast v1.6.0 // indirect
2339
github.com/spf13/pflag v1.0.5 // indirect
2440
github.com/subosito/gotenv v1.6.0 // indirect
41+
go.opencensus.io v0.24.0 // indirect
42+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
43+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
44+
go.opentelemetry.io/otel v1.29.0 // indirect
45+
go.opentelemetry.io/otel/metric v1.29.0 // indirect
46+
go.opentelemetry.io/otel/trace v1.29.0 // indirect
2547
go.uber.org/atomic v1.9.0 // indirect
2648
go.uber.org/multierr v1.9.0 // indirect
49+
golang.org/x/crypto v0.28.0 // indirect
2750
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
28-
golang.org/x/sys v0.15.0 // indirect
29-
golang.org/x/text v0.14.0 // indirect
51+
golang.org/x/net v0.30.0 // indirect
52+
golang.org/x/oauth2 v0.23.0 // indirect
53+
golang.org/x/sync v0.8.0 // indirect
54+
golang.org/x/sys v0.26.0 // indirect
55+
golang.org/x/text v0.19.0 // indirect
56+
golang.org/x/time v0.7.0 // indirect
57+
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
58+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
59+
google.golang.org/grpc v1.67.1 // indirect
60+
google.golang.org/protobuf v1.35.1 // indirect
3061
gopkg.in/ini.v1 v1.67.0 // indirect
3162
)

0 commit comments

Comments
 (0)