Skip to content

Assignment 2#105

Closed
atsuvovor wants to merge 6 commits intoUofT-DSI:mainfrom
atsuvovor:assignment-2
Closed

Assignment 2#105
atsuvovor wants to merge 6 commits intoUofT-DSI:mainfrom
atsuvovor:assignment-2

Conversation

@atsuvovor
Copy link

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

Implemente a modular conversational AI system supporting: API-based animal and horoscope tools, semantic music review search, and a custom risk calculator. Update the project structure and guardrails, integrate ChromaDB for local music embeddings, and improved environment variable handling.

What did you learn from the changes you have made?

I learned how to structure a conversational system using LangGraph, apply guardrails before LLM execution, integrate external tools safely, and implement retrieval-augmented generation with a vector database. I also reinforced best practices for Python packaging and environment configuration.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Initially, I considered using a Dockerized ChromaDB together with PostgreSQL to store and retrieve music review embeddings dynamically. However, this approach proved complex for local development, so I switched to a simpler setup where ChromaDB persists locally in assignment_chat/chroma_db, making it easier to build and query the database without relying on live containers.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

Loading environment variables correctly for API keys and LangSmith. Fixed by using load_dotenv() for both .env and .secrets.
ChromaDB queries failing if containers were not running. Resolved by switching to a persistent local ChromaDB.
Guardrails enforcement needed careful handling to block forbidden topics and prompt injections.

How were these changes tested?

Tested locally by running python -m assignment_chat.app with the Gradio chat interface, invoking all tools (animals, horoscope, music, risk calculator), and verifying that guardrails blocked restricted inputs

A reference to a related issue in your repository (if applicable)

No open issue; this PR implements all assignment requirements for Assignment 2.

Checklist

  • I can confirm that my changes are working as intended

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Hello, thank you for your contribution. If you are a participant, please close this pull request and open it in your own forked repository instead of here. Please read the instructions on your onboarding Assignment Submission Guide more carefully. If you are not a participant, please give us up to 72 hours to review your PR. Alternatively, you can reach out to us directly to expedite the review process.

@atsuvovor atsuvovor closed this Mar 1, 2026
@atsuvovor
Copy link
Author

I opened this PR by mistake. I should open it on my repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant