Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nram/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*/node_modules
*/.env
54 changes: 54 additions & 0 deletions nram/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"version": "2.0.0",
"presentation": {
"echo": false,
"reveal": "always",
"focus": false,
"panel": "dedicated",
"showReuseMessage": true
},
"tasks": [
{
"label": "Create Terminals",
"dependsOn": ["client", "server", "tsc"],
"group": {
"isDefault": true
},
"runOptions": {
"runOn": "folderOpen"
},
"type": "shell",
"command": "bash"
},
{
"label": "client",
"type": "shell",
"command": "cd client && npm install && npm run dev",
"isBackground": true,
"problemMatcher": [],
"presentation": {
"group": "my-group"
}
},
{
"label": "server",
"type": "shell",
"command": "cd server && npm install && npm start",
"isBackground": true,
"problemMatcher": [],
"presentation": {
"group": "my-group"
}
},
{
"label": "tsc",
"type": "shell",
"command": "cd server && tsc -w",
"isBackground": true,
"problemMatcher": [],
"presentation": {
"group": "compile"
}
}
]
}
59 changes: 59 additions & 0 deletions nram/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#### Team Name - N-RAM
#### Problem Statement - A 3D AI interface for personalized, trustworthy education on securities markets, empowering investors to navigate financial decisions
#### Team Leader Email - [email protected]

## A Brief of the Prototype:
At the prototype level:

- We offer an immersive speech based solution where users can have
- Interactive conversation with the AI model
- The model as a personalized AI companion that helps in portfolio specific way based on the user queries to- optimize their financial understanding.
- The knowledge of current insights and trends of the market.
- Comfort of limited typing ability or prefer verbal communication.
- discover new investment opportunities and strategies
- More market experience with each interaction
- Get Tip of the day to learn more everyday.
- All the interactions are saved so that every next conversation could be more personalised to the user than before.
Further, we have planned to include a points based system where each interaction gives more user specific experience (exp) points. The model will also provide external links to get more insights on the given scenario as a reference.

Use Case Diagram:

![UseCase](../nram/usecase.png)


## Tech Stack:
- WhisperAI
- PaLM API
- OAuth
- ThreeJS
- Vite + React
- TailwindCSS
- TypeScript
- NodeJS
- ExpressJS
- MongoDB

## Step-by-Step Code Execution Instructions:
- Clone the repository using
```
git clone https://github.com/ashishlal2003/Empowering-Investors-Hackathon.git
```
- ```cd nram```
- Request for the ```.env``` file from the project manager - [email protected]
- Place the file in the ```server``` folder.
- By default, in VSCode, the web-app starts automatically through the in-built terminal. It can be directly then accessed on ```localhost:3000```.
- If not, run the following commands:
Open two terminal windows
1. ``` cd client && npm install && npm run dev ```
2. ``` cd server && npm install && npm start ```

## What I Learned:
We as a team learnt a lot of aspects of project development through this hackathon. Some of them include:
- Implementation of Generative AI (using PaLM model API by Google)
- Implementation of ThreeJS (for the 3d avatar)
- Understanding the securities market and what a user can expect to learn.
- Collaboration
- Leadership
- Resolving internal conflicts
- Time management
- Prioritisation
22 changes: 22 additions & 0 deletions nram/api/palmAPI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pprint
import google.generativeai as palm

palm.configure(api_key='AIzaSyCcrKRaX4Lx5RjcjEaY7IYN1dA7UUTFm1M')

models = [m for m in palm.list_models() if 'generateText' in m.supported_generation_methods]
model = models[0].name
print(model)

prompt = """
Should i invest in gold bond or in stock market?
"""

completion = palm.generate_text(
model=model,
prompt=prompt,
temperature=0,
# The maximum length of the response
max_output_tokens=100,
)

print(completion.result)
Binary file added nram/api/sample.wav
Binary file not shown.
15 changes: 15 additions & 0 deletions nram/api/speech2text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import speech_recognition as sr

filename = "sample.wav"

# initialize the recognizer
r = sr.Recognizer()

# open the file
with sr.AudioFile(filename) as source:
# listen for the data (load audio to memory)
audio_data = r.record(source)
# recognize (convert from speech to text)
text = r.recognize_google(audio_data)
print(text)

2 changes: 2 additions & 0 deletions nram/api/tempCodeRunnerFile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import pprint
import google.generativeai as palm
20 changes: 20 additions & 0 deletions nram/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions nram/client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
8 changes: 8 additions & 0 deletions nram/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
13 changes: 13 additions & 0 deletions nram/client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NRAM.ai</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
Loading