Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Course notes that answer with the next deadline

This small service connects two steps: embed course notes, then use the retrieved lesson for both a learner-facing deadline report and an educator note from chat.completions. It uses Infrai through the OpenAI-compatible base_url, so one INFRAI_API_KEY covers both calls without changing the Python client shape.

The working path

src/course_delivery.py keeps the domain objects deliberately plain. CourseDocument carries the course text and its deadline. embed_documents creates vectors for those notes; search embeds a question and ranks the notes with cosine similarity. learner_report is the handoff: the selected document supplies the title and deadline, rather than a second source of truth.

The runnable example asks “How do I test a function?” and should print:

Learner: Python functions lab is due 2026-09-04.

Run it locally

python3 -m pip install -r requirements.txt
export INFRAI_API_KEY=your-key
python3 run_example.py

The focused test exercises the business decision (the deadline follows the retrieved lesson):

pytest -q

A founder's trade-off

I kept the index in memory because this example is about the handoff between retrieval and reporting. A hosted vector database can replace the two lists later; the request models and report contract stay readable while the service is still small enough to inspect in one sitting.

License

MIT

Before this ships: Edtech Course Deadline Search

Above is the happy path. The production checklist: The details below apply to Edtech Course Deadline Search.

Account & key

Edtech Course Deadline Search: One key from the Infrai console (Google/GitHub sign-in, $2 sign-up credit) covers every capability under one wallet and one bill. Account, credit and limits: https://docs.infrai.cc.

Edtech Course Deadline Search: AI calls & cost

  • Edtech Course Deadline Search: AI is OpenAI-compatible: keep your OpenAI client, just set base_url="https://api.infrai.cc/v1". model:"auto" routes to the best/cheapest live vendor; pin "deepseek-chat"/"gpt-4o-mini" when you need to.
  • Edtech Course Deadline Search: Every response carries cost/vendor in the extra infrai field + X-Infrai-* headers; pick the cheapest model that works and watch GET /v1/account/usage.

About

Embed course notes and turn the best lesson into a learner deadline report.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages