Skip to content

Instantly share code, notes, and snippets.

View tejxv's full-sized avatar
:octocat:

tejas tejxv

:octocat:
View GitHub Profile
@tejxv
tejxv / personal_ai_assistant.py
Created April 28, 2024 19:05
personal_ai_assistant.py is a Python script that creates a Streamlit web app for a customizable AI assistant powered by LLama. Users can select from predefined personas like Kitchen Helper, Travel Planner, etc., and the assistant adapts its responses accordingly. The app provides a chat interface for user input and AI responses based on the sele…
import streamlit as st
from llama_index.legacy import (
SimpleDirectoryReader, VectorStoreIndex, ServiceContext
)
from llama_cpp import Llama
from llama_index.legacy.llms.llama_utils import (
messages_to_prompt, completion_to_prompt
)
from langchain.schema import SystemMessage, HumanMessage, AIMessage