Skip to content

Commit

Permalink
fix: fix the mis-spelling on Elaine's name
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyli committed Jun 25, 2024
1 parent 50758d2 commit 15239b4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions jobs/RAG/chat_history_with_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
# Conversation history
chat_history = [
"John: Have you heard about the new Italian restaurant downtown?",
"Elain: Yes, I did! Sarah mentioned it to me yesterday. She said the pasta there is amazing.",
"Elaine: Yes, I did! Sarah mentioned it to me yesterday. She said the pasta there is amazing.",
"John: I was thinking of going there this weekend. Want to join?",
"Elain: That sounds great! Maybe we can invite Sarah too.",
"Elaine: That sounds great! Maybe we can invite Sarah too.",
"John: Good idea. By the way, did you catch the latest episode of that mystery series we were discussing last week?",
"Elain: Oh, the one with the detective in New York? Yes, I watched it last night. It was so intense!",
"Elaine: Oh, the one with the detective in New York? Yes, I watched it last night. It was so intense!",
"John: I know, right? I didn't expect that plot twist at the end. Do you think Sarah has seen it yet?",
"Elain: I'm not sure. She was pretty busy with work the last time we talked. We should ask her when we see her at the restaurant.",
"Elaine: I'm not sure. She was pretty busy with work the last time we talked. We should ask her when we see her at the restaurant.",
"John: Definitely. Speaking of Sarah, did she tell you about her trip to Italy next month?",
"Elain: Yes, she did. She's so excited about it! She's planning to visit a lot of historical sites.",
"Elaine: Yes, she did. She's so excited about it! She's planning to visit a lot of historical sites.",
"John: I bet she'll have a great time. Maybe she can bring back some authentic Italian recipes for us to try.",
]

Expand All @@ -40,9 +40,9 @@
# Create prompt template
prompt_template_with_context = """
Elaine prefers to talk using telegraphic messages.
Given a chat history and Elain's latest response which
Given a chat history and Elaine's latest response which
might reference context in the chat history, convert
Elain's response to full sentences. Only respond with
Elaine's response to full sentences. Only respond with
converted full sentences.
Chat history:
Expand Down
10 changes: 5 additions & 5 deletions jobs/RAG/chat_history_with_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
# Chat history
chat_history = [
"John: Have you heard about the new Italian restaurant downtown?",
"Elain: Yes, I did! Sarah mentioned it to me yesterday. She said the pasta there is amazing.",
"Elaine: Yes, I did! Sarah mentioned it to me yesterday. She said the pasta there is amazing.",
"John: I was thinking of going there this weekend. Want to join?",
"Elain: That sounds great! Maybe we can invite Sarah too.",
"Elaine: That sounds great! Maybe we can invite Sarah too.",
"John: Good idea. By the way, did you catch the latest episode of that mystery series we were discussing last week?",
"Elain: Oh, the one with the detective in New York? Yes, I watched it last night. It was so intense!",
"Elaine: Oh, the one with the detective in New York? Yes, I watched it last night. It was so intense!",
"John: I know, right? I didn't expect that plot twist at the end. Do you think Sarah has seen it yet?",
"Elain: I'm not sure. She was pretty busy with work the last time we talked. We should ask her when we see her at the restaurant.",
"Elaine: I'm not sure. She was pretty busy with work the last time we talked. We should ask her when we see her at the restaurant.",
"John: Definitely. Speaking of Sarah, did she tell you about her trip to Italy next month?",
"Elain: Yes, she did. She's so excited about it! She's planning to visit a lot of historical sites.",
"Elaine: Yes, she did. She's so excited about it! She's planning to visit a lot of historical sites.",
"John: I bet she'll have a great time. Maybe she can bring back some authentic Italian recipes for us to try.",
]
recent_chat_array = []
Expand Down
6 changes: 3 additions & 3 deletions jobs/RAG/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
llm = ChatOllama(model="llama3", system="Elaine is an AAC user who expresses herself telegraphically. She is now in a meeting with Jutta. Below is the conversation in the meeting. Please help to convert what Elaine said to first-person sentences. Only respond with converted sentences.")
prompt = ChatPromptTemplate.from_template(prompt_template_with_context)

elain_reply = "Roy nephew"
full_chat = f"Jutta: Elain, who would you like to invite to your birthday party?\n Elaine: {elain_reply}."
elaine_reply = "Roy nephew"
full_chat = f"Jutta: Elaine, who would you like to invite to your birthday party?\n Elaine: {elaine_reply}."

# using LangChain Expressive Language (LCEL) chain syntax
chain = prompt | llm | StrOutputParser()
Expand All @@ -76,6 +76,6 @@
print("====== Response with RAG ======")

print(chain.invoke({
"context": retriever.invoke(elain_reply),
"context": retriever.invoke(elaine_reply),
"chat": full_chat
}) + "\n")

0 comments on commit 15239b4

Please sign in to comment.