thinkly.ai-backend's People
Forkers
gregsvein55thinkly.ai-backend's Issues
Token Count for billing
We need to be able to count the amount the tokens each user uses.
We will push each usage to firestore.
- Setup firestore on the backend
- Add a function to push the usage to the db
- For each backend call to GPT, we need to push the token count to the DB
Assignments: Take average from graded assignments
Run the grading scheme 3 times in parallel, take the outputs from each, plug them into another prompt and get GPT to give the average score.
Add chat streaming capability for GPT API.
There will be a section of the notes page where the user can ask questions regarding the notes.
For this feature we will need the chat streaming capability.
Here is the streaming documentation:
https://github.com/openai/openai-cookbook/blob/main/examples/How_to_stream_completions.ipynb
We will also need a socket set up using Socket.io python client. Here is the documentation:
https://python-socketio.readthedocs.io/en/latest/
- Get the streaming capability working.
- Get the socket working.
- Get both working together.
Tokenize
We need to count the number of tokens used by the user before prompting.
Use this library: tiktoken
Resources:
https://github.com/openai/openai-cookbook/blob/main/examples/How_to_count_tokens_with_tiktoken.ipynb
https://github.com/openai/tiktoken/blob/main/README.md
Generate the whole curriculum at once
As of right now, fetching each unit independently is not working properly, so we need to be able to fetch the entire curriculum all at once.
Additionally, having the learning objectives, textbooks, prerequisites and course name and description are seeming to confuse gpt.
So make sure the function takes in only a user prompt.
Remove all functions that are not being used from the project
Remove all of the functions we are not using in the backend.
Test AWS Chalice
Check to see how AWS chalice works then get the backend running with lambda.
Stream Responses
Stream the responses for specific prompts.
ie, when user is questioning notes + assignments.
Find other cases that would benefit from streaming.
Accept user prompt for self learning
Allow the user to enter a prompt on what they wish to learn.
From there GPT will auto generate the learning objectives.
Backend: User asks question about text
Make a function that takes in the existing text from the notes and the users question.
Get GPT to respond to the question.
Generate subtopics for unit
Create a function that generates subtopics for a given unit.
Adjust top_p & temp depending on type of query
Adjusting the temperature and top_p parameters can change the output of the model in various ways. Here are some scenarios where you might want to alter them:
Temperature:
Creative Writing: If you're using the model for creative writing or brainstorming and you want diverse, unexpected responses, a higher temperature like 0.8 might be appropriate. This introduces more randomness in the outputs.
Technical Writing: If you're generating technical or professional content where consistency and focus are crucial, a lower temperature like 0.2 might be better. This makes the output more deterministic and focused.
Top_p (Nucleus Sampling):
High-Stakes Decision Making: If you're using the model to help with high-stakes decisions where accuracy is critical, a lower top_p value like 0.1 could be useful. This restricts the model's responses to the most probable tokens.
Exploratory Conversations: If you're having an exploratory conversation and want a good balance between diversity and relevance, a higher top_p value like 0.9 could be suitable. This allows the model to consider a broader range of token possibilities.
Remember that both parameters control the trade-off between diversity and determinism in the model's responses. They should be adjusted according to the specific requirements of your task. As the documentation suggests, it's generally recommended to adjust either temperature or top_p, not both, to avoid confusion and unexpected behavior.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.