forked from React-Group/interstellar_ai
		
	Merge pull request 'installed axios' (#19) from YasinOnm08/interstellar_ai:main into main
Reviewed-on: https://interstellardevelopment.org/code/code/React-Group/interstellar_ai/pulls/19
This commit is contained in:
		
						commit
						87b967aecb
					
				
					 4 changed files with 142 additions and 0 deletions
				
			
		
							
								
								
									
										39
									
								
								app/AudioRecorder(not yet).tsx
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								app/AudioRecorder(not yet).tsx
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,39 @@ | ||||||
|  | // import React, { useState, useRef } from 'react'
 | ||||||
|  | 
 | ||||||
|  | // const AudioRecorder: React.FC = () => {
 | ||||||
|  | //     const [isRecording, setIsRecording] = useState(false)
 | ||||||
|  | //     const [audioURL, setAudioURL] = useState<string | null>(null)
 | ||||||
|  | //     const medaRecorderRef = useRef<MediaRecorder | null>(null)
 | ||||||
|  | //     const audioChunks = useRef<Blob[]>([])
 | ||||||
|  | 
 | ||||||
|  | //     const startRecording = async () => {
 | ||||||
|  | //         const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
 | ||||||
|  | //         const mediaRecorder = new MediaRecorder(stream)
 | ||||||
|  | //         medaRecorderRef.current = mediaRecorder
 | ||||||
|  | 
 | ||||||
|  | //         mediaRecorder.ondataavailable = (event) => {
 | ||||||
|  | //             audioChunks.current.push(event.data)
 | ||||||
|  | //         }
 | ||||||
|  | 
 | ||||||
|  | //         mediaRecorder.onstop = () => {
 | ||||||
|  | //             const audioBlob = new Blob(audioChunks.current, { type: "audio/wav" })
 | ||||||
|  | //             const url = URL.createObjectURL(audioBlob)
 | ||||||
|  | //             setAudioURL(url)
 | ||||||
|  | //             audioChunks.current = []
 | ||||||
|  | //         }
 | ||||||
|  | 
 | ||||||
|  | //         mediaRecorder.start()
 | ||||||
|  | //         setIsRecording(true)
 | ||||||
|  | 
 | ||||||
|  | //         const stopRecording = () => {
 | ||||||
|  | //             medaRecorderRef.current?.stop()
 | ||||||
|  | //             setIsRecording(false)
 | ||||||
|  | //         }
 | ||||||
|  | 
 | ||||||
|  | //         return (
 | ||||||
|  | //             <div></div>
 | ||||||
|  | //         )
 | ||||||
|  | //     }
 | ||||||
|  | // }
 | ||||||
|  | 
 | ||||||
|  | // export default AudioRecorder
 | ||||||
							
								
								
									
										2
									
								
								app/ProcessAPI.tsx
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								app/ProcessAPI.tsx
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,2 @@ | ||||||
|  | import React from "react"; | ||||||
|  | import axios from 'axios'; | ||||||
							
								
								
									
										100
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										100
									
								
								package-lock.json
									
										
									
										generated
									
									
									
								
							|  | @ -9,6 +9,7 @@ | ||||||
|       "version": "0.1.0", |       "version": "0.1.0", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@mistralai/mistralai": "^1.0.4", |         "@mistralai/mistralai": "^1.0.4", | ||||||
|  |         "axios": "^1.7.7", | ||||||
|         "fs": "^0.0.1-security", |         "fs": "^0.0.1-security", | ||||||
|         "next": "14.2.12", |         "next": "14.2.12", | ||||||
|         "ollama": "^0.5.9", |         "ollama": "^0.5.9", | ||||||
|  | @ -1048,6 +1049,12 @@ | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT" |       "license": "MIT" | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/asynckit": { | ||||||
|  |       "version": "0.4.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", | ||||||
|  |       "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", | ||||||
|  |       "license": "MIT" | ||||||
|  |     }, | ||||||
|     "node_modules/available-typed-arrays": { |     "node_modules/available-typed-arrays": { | ||||||
|       "version": "1.0.7", |       "version": "1.0.7", | ||||||
|       "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", |       "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", | ||||||
|  | @ -1074,6 +1081,17 @@ | ||||||
|         "node": ">=4" |         "node": ">=4" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/axios": { | ||||||
|  |       "version": "1.7.7", | ||||||
|  |       "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", | ||||||
|  |       "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", | ||||||
|  |       "license": "MIT", | ||||||
|  |       "dependencies": { | ||||||
|  |         "follow-redirects": "^1.15.6", | ||||||
|  |         "form-data": "^4.0.0", | ||||||
|  |         "proxy-from-env": "^1.1.0" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|     "node_modules/axobject-query": { |     "node_modules/axobject-query": { | ||||||
|       "version": "4.1.0", |       "version": "4.1.0", | ||||||
|       "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", |       "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", | ||||||
|  | @ -1280,6 +1298,18 @@ | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "MIT" |       "license": "MIT" | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/combined-stream": { | ||||||
|  |       "version": "1.0.8", | ||||||
|  |       "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", | ||||||
|  |       "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", | ||||||
|  |       "license": "MIT", | ||||||
|  |       "dependencies": { | ||||||
|  |         "delayed-stream": "~1.0.0" | ||||||
|  |       }, | ||||||
|  |       "engines": { | ||||||
|  |         "node": ">= 0.8" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|     "node_modules/commander": { |     "node_modules/commander": { | ||||||
|       "version": "4.1.1", |       "version": "4.1.1", | ||||||
|       "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", |       "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", | ||||||
|  | @ -1487,6 +1517,15 @@ | ||||||
|         "url": "https://github.com/sponsors/ljharb" |         "url": "https://github.com/sponsors/ljharb" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/delayed-stream": { | ||||||
|  |       "version": "1.0.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", | ||||||
|  |       "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", | ||||||
|  |       "license": "MIT", | ||||||
|  |       "engines": { | ||||||
|  |         "node": ">=0.4.0" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|     "node_modules/didyoumean": { |     "node_modules/didyoumean": { | ||||||
|       "version": "1.2.2", |       "version": "1.2.2", | ||||||
|       "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", |       "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", | ||||||
|  | @ -2316,6 +2355,26 @@ | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "ISC" |       "license": "ISC" | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/follow-redirects": { | ||||||
|  |       "version": "1.15.9", | ||||||
|  |       "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", | ||||||
|  |       "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", | ||||||
|  |       "funding": [ | ||||||
|  |         { | ||||||
|  |           "type": "individual", | ||||||
|  |           "url": "https://github.com/sponsors/RubenVerborgh" | ||||||
|  |         } | ||||||
|  |       ], | ||||||
|  |       "license": "MIT", | ||||||
|  |       "engines": { | ||||||
|  |         "node": ">=4.0" | ||||||
|  |       }, | ||||||
|  |       "peerDependenciesMeta": { | ||||||
|  |         "debug": { | ||||||
|  |           "optional": true | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|     "node_modules/for-each": { |     "node_modules/for-each": { | ||||||
|       "version": "0.3.3", |       "version": "0.3.3", | ||||||
|       "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", |       "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", | ||||||
|  | @ -2343,6 +2402,20 @@ | ||||||
|         "url": "https://github.com/sponsors/isaacs" |         "url": "https://github.com/sponsors/isaacs" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/form-data": { | ||||||
|  |       "version": "4.0.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", | ||||||
|  |       "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", | ||||||
|  |       "license": "MIT", | ||||||
|  |       "dependencies": { | ||||||
|  |         "asynckit": "^0.4.0", | ||||||
|  |         "combined-stream": "^1.0.8", | ||||||
|  |         "mime-types": "^2.1.12" | ||||||
|  |       }, | ||||||
|  |       "engines": { | ||||||
|  |         "node": ">= 6" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|     "node_modules/fs": { |     "node_modules/fs": { | ||||||
|       "version": "0.0.1-security", |       "version": "0.0.1-security", | ||||||
|       "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", |       "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", | ||||||
|  | @ -3419,6 +3492,27 @@ | ||||||
|         "node": ">=8.6" |         "node": ">=8.6" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/mime-db": { | ||||||
|  |       "version": "1.52.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", | ||||||
|  |       "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", | ||||||
|  |       "license": "MIT", | ||||||
|  |       "engines": { | ||||||
|  |         "node": ">= 0.6" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "node_modules/mime-types": { | ||||||
|  |       "version": "2.1.35", | ||||||
|  |       "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", | ||||||
|  |       "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", | ||||||
|  |       "license": "MIT", | ||||||
|  |       "dependencies": { | ||||||
|  |         "mime-db": "1.52.0" | ||||||
|  |       }, | ||||||
|  |       "engines": { | ||||||
|  |         "node": ">= 0.6" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|     "node_modules/minimatch": { |     "node_modules/minimatch": { | ||||||
|       "version": "3.1.2", |       "version": "3.1.2", | ||||||
|       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", |       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", | ||||||
|  | @ -4071,6 +4165,12 @@ | ||||||
|         "react-is": "^16.13.1" |         "react-is": "^16.13.1" | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "node_modules/proxy-from-env": { | ||||||
|  |       "version": "1.1.0", | ||||||
|  |       "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", | ||||||
|  |       "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", | ||||||
|  |       "license": "MIT" | ||||||
|  |     }, | ||||||
|     "node_modules/punycode": { |     "node_modules/punycode": { | ||||||
|       "version": "2.3.1", |       "version": "2.3.1", | ||||||
|       "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", |       "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", | ||||||
|  |  | ||||||
|  | @ -10,6 +10,7 @@ | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@mistralai/mistralai": "^1.0.4", |     "@mistralai/mistralai": "^1.0.4", | ||||||
|  |     "axios": "^1.7.7", | ||||||
|     "fs": "^0.0.1-security", |     "fs": "^0.0.1-security", | ||||||
|     "next": "14.2.12", |     "next": "14.2.12", | ||||||
|     "ollama": "^0.5.9", |     "ollama": "^0.5.9", | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue