Add tests for 349a2bbbb6
				
					
				
			This commit is contained in:
		
							parent
							
								
									ca03f5c5a4
								
							
						
					
					
						commit
						5d8eed54d8
					
				
					 1 changed files with 29 additions and 7 deletions
				
			
		|  | @ -1,17 +1,39 @@ | |||
| import Tests from './prompt.js'; | ||||
| import { Buffer } from 'buffer'; | ||||
| 
 | ||||
| // Importing modules for simulated data
 | ||||
| import fs from 'fs'; | ||||
| 
 | ||||
| 
 | ||||
| class main { | ||||
|     constructor() { | ||||
|         this.platform = new Tests(); | ||||
|         this.first(); | ||||
|         // this.first()
 | ||||
|          | ||||
|         this.testWithData() | ||||
|     } | ||||
| 
 | ||||
|      | ||||
|     first () { | ||||
|         let result = this.platform.generate("gemini-1.5-flash", "What is a TPU?"); | ||||
|         result.then((log) => { | ||||
|             console.log(log.text) | ||||
|         }) | ||||
|     } | ||||
|       let result = this.platform.generate("gemini-1.5-flash", "What is a TPU?"); | ||||
|       result.then((log) => { | ||||
|           console.log(log.text) | ||||
|       }) | ||||
|     }; | ||||
| 
 | ||||
|     testWithData () { | ||||
|       let results = []; | ||||
|       let files = [{ | ||||
|         inlineData: { | ||||
|           mimeType: 'text/csv', | ||||
|           data: Buffer.from(fs.readFileSync("data/test.csv")).toString("base64") | ||||
|         } | ||||
|       }]; | ||||
| 
 | ||||
|       let result = this.platform.analyzefile("gemini-1.5-flash", "Please summarize this document. Also, how many unique groups are there? ", files); | ||||
|       result.then((log) => { | ||||
|           console.log(log.text) | ||||
|       }) | ||||
|     }; | ||||
| } | ||||
| 
 | ||||
| let runtime = new main(); | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue