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
Binary file added littleX_BE/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,21 @@ impl load_feed.load {
impl load_feed.report_feed {
self.results.sort(key=lambda x:dict:x['similarity'][0], reverse=True);
report self.results;
}

impl chat_with_ai.chat {
feeds = root spawn load_feed();
context = [i.get("Tweet_Info","") for i in feeds.results];

response = self.generate_response(
message=self.message,
chat_history=self.chat_history,
tweets_context=context
);

self.chat_history.append({"role": "user", "content": self.message});
self.chat_history.append({"role": "assistant", "content": response});
self.response = response;

report {"response": response, "chat_history": self.chat_history};
}
16 changes: 16 additions & 0 deletions littleX_BE/littleX.jac → littleX_BE/littleX.jac 20.18.12
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import datetime;
import numpy;
import from sklearn.feature_extraction.text { TfidfVectorizer }
import from sklearn.metrics.pairwise { cosine_similarity }
import from byllm.llm {Model}

glob vectorizer = TfidfVectorizer();
glob llm = Model(model_name="gemini/gemini-2.5-flash");
#glob llm = Model(model_name="gemini/gemini-2.5-flash" , verbose=True);

def search_tweets(query: str, tweet:str) -> int;

Expand Down Expand Up @@ -119,4 +122,17 @@ walker load_feed(visit_profile) {

can report_feed with exit;

}

walker chat_with_ai {
has message: str;
has chat_history: list[dict] = [];
has response: str = "";

"""Generate helpful responses about tweets and social interactions.
Analyze tweet content, provide insights, answer questions about the feed."""
def generate_response(message: str, chat_history: list[dict], tweets_context: str) -> str
by llm(method="ReAct", temperature=0.7);

can chat with `root entry;
}