Skip to content

Commit c74e6e4

Browse files
committed
fix linting
1 parent 5324a1b commit c74e6e4

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

genai/controller/generate_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def upload_file():
8080
def generate():
8181
"""API Endpoint for generating recipe response based on document retrieval
8282
83-
This endpoint processes user queries against a vector database of recipes
83+
This endpoint processes user queries against a vector database of recipes
8484
and returns AI-generated responses using retrieved context.
8585
8686
Request Body:

genai/rag/llm/chat_model.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ChatModel(BaseChatModel):
1111
model_name: str = Field(default="llama3.3:latest")
1212

1313
def _generate(self, messages: List[BaseMessage],
14-
stop=None,
14+
stop=None,
1515
**kwargs) -> ChatResult:
1616
prompt = "\n".join([
1717
msg.content for msg in messages if isinstance(msg, HumanMessage)
@@ -31,18 +31,21 @@ def _llm_type(self) -> str:
3131
def get_system_prompt(self) -> str:
3232
"""System prompt for the LLM"""
3333
return """
34-
You are RecipAI, an intelligent assistant that helps users discover and generate
35-
recipes based on the ingredients they provide.
36-
37-
Use the contextual information provided below to tailor your responses.
38-
39-
If relevant recipes or suggestions are found in the context, prioritize
40-
those. If no relevant context is available, use your own knowledge to help the user.
34+
You are an intelligent assistant that helps users discover
35+
and generate recipes based on the ingredients they provide.
36+
37+
Use the contextual information provided below to tailor
38+
your responses.
39+
40+
If relevant recipes or suggestions are found in the context,
41+
prioritize those. If no relevant context is available,
42+
use your own knowledge to help the user.
4143
4244
Context:
4345
{context}
4446
45-
Be clear, creative, and helpful. If the user also asks follow-up
46-
questions (e.g., dietary adjustments, name references, meal timing),
47-
answer them precisely based on the context and query.
47+
Be clear, creative, and helpful. If the user also asks
48+
follow-up questions (e.g., dietary adjustments, name references,
49+
meal timing), answer them precisely based on the
50+
context and query.
4851
"""

genai/service/rag_service.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from langchain_qdrant import QdrantVectorStore
44
from langchain_core.messages import BaseMessage, HumanMessage
55
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
6-
from genai.rag.llm.chat_model import ChatModel
6+
# from genai.rag.llm.chat_model import ChatModel
77

88

99
def retrieve_similar_docs(vector_store: QdrantVectorStore, user_query: str):
@@ -37,6 +37,9 @@ def prepare_prompt(system_prompt: str,
3737
# if __name__ == "__main__":
3838
# msg = HumanMessage(content="My name is John Doe.")
3939
# llm = ChatModel()
40-
# prompt = prepare_prompt(llm.get_system_prompt(), "Suggest me a basic breakfast. Btw, what is my name?", "", [msg])
40+
# prompt = prepare_prompt(llm.get_system_prompt(),
41+
# "Suggest me a basic breakfast. Btw, what is my name?",
42+
# "",
43+
# [msg])
4144
# response = llm.invoke(prompt)
42-
# print(response.content)
45+
# print(response.content)

0 commit comments

Comments
 (0)