This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree 2 files changed +37
-2
lines changed
pages/ApplicationEvaluationOverviewPage
2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { Hex } from "viem" ;
2
2
3
3
import { PoolSummary , ProjectBanner } from "@/components" ;
4
- import { syncPool } from "@/mainAll" ;
4
+ import { triggerLLM } from "@/mainAll" ;
5
5
import { Button , Icon , IconType } from "@/primitives" ;
6
6
7
7
import { EvaluationList } from "~checker/components" ;
@@ -44,9 +44,11 @@ export const ApplicationEvaluationOverviewPage = ({
44
44
} ;
45
45
46
46
const syncAndRefresh = async ( ) => {
47
- await syncPool ( {
47
+ await triggerLLM ( {
48
48
chainId,
49
49
alloPoolId : poolId ,
50
+ alloApplicationId : applicationId ,
51
+ signature : "0xdeadbeef" ,
50
52
} ) ;
51
53
dispatch ( goToApplicationEvaluationOverviewAction ( { projectId : applicationId } ) ) ;
52
54
} ;
Original file line number Diff line number Diff line change @@ -7,6 +7,13 @@ export interface SyncPoolBody {
7
7
alloPoolId : string ;
8
8
}
9
9
10
+ export interface TriggerLLMBody {
11
+ chainId : number ;
12
+ alloPoolId : string ;
13
+ alloApplicationId : string ;
14
+ signature : string ;
15
+ }
16
+
10
17
export async function submitEvaluation (
11
18
evaluationBody : EvaluationBody ,
12
19
) : Promise < { evaluationId : string } > {
@@ -61,6 +68,32 @@ export async function syncPool(syncPoolBody: SyncPoolBody): Promise<boolean> {
61
68
}
62
69
}
63
70
71
+ export async function triggerLLM ( triggerLLMBody : TriggerLLMBody ) : Promise < boolean > {
72
+ const url = `${ CHECKER_ENDPOINT } /api/evaluate/llm` ;
73
+
74
+ try {
75
+ const response = await fetch ( url , {
76
+ method : "POST" ,
77
+ headers : {
78
+ "Content-Type" : "application/json" ,
79
+ } ,
80
+ body : JSON . stringify ( {
81
+ ...triggerLLMBody ,
82
+ } ) ,
83
+ } ) ;
84
+
85
+ if ( ! response . ok ) {
86
+ const errorData = await response . json ( ) ;
87
+ throw new Error ( `Error: ${ response . status } - ${ errorData . message || "Unknown error" } ` ) ;
88
+ }
89
+
90
+ return true ;
91
+ } catch ( error ) {
92
+ console . error ( "Error triggering LLM:" , error ) ;
93
+ throw error ;
94
+ }
95
+ }
96
+
64
97
export async function verifyCredentials (
65
98
application : Partial < ProjectApplicationForManager > ,
66
99
) : Promise < { twitter : boolean ; github : boolean } > {
You can’t perform that action at this time.
0 commit comments