Update app.py
Browse files
app.py
CHANGED
@@ -68,7 +68,7 @@ concise_text = dataset["concise"]["text"]
|
|
68 |
concise_text_string = "".join(concise_text)
|
69 |
|
70 |
# Chunk and index the documents
|
71 |
-
chunks = chunk_text(concise_text_string, chunk_size=
|
72 |
# Build the vectorsore
|
73 |
vectorstore = build_faiss_vectorstore(chunks)
|
74 |
|
@@ -99,14 +99,14 @@ async def chat(request: ChatRequest):
|
|
99 |
|
100 |
|
101 |
# Retrieve relevant text
|
102 |
-
docs, filtered_docs_and_scores = retrieve(request.message, vectorstore, top_k=
|
103 |
docs = "\n\n".join(docs)
|
104 |
|
105 |
rag_prompt = f"""Use the following information to answer the user's query. You do not have to use all the information, just the pieces that directly
|
106 |
help answer the query most accurately. Start directly with information, NOT with a question, and NOT restating the subject matter of the user query in
|
107 |
any way, or you will be penalized. Respond in a conversational manner.
|
108 |
|
109 |
-
Here
|
110 |
|
111 |
User Query: How do big bucks use clear cuts for bedding?
|
112 |
|
@@ -118,6 +118,25 @@ async def chat(request: ChatRequest):
|
|
118 |
meets older timber. They’ll set up with the wind at their back so they can smell anything sneaking up behind them, and they’re looking out into the open
|
119 |
woods, watching for danger.
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
|
123 |
You have access to the following relevant information retrieved based on the user's query:
|
|
|
68 |
concise_text_string = "".join(concise_text)
|
69 |
|
70 |
# Chunk and index the documents
|
71 |
+
chunks = chunk_text(concise_text_string, chunk_size=400)
|
72 |
# Build the vectorsore
|
73 |
vectorstore = build_faiss_vectorstore(chunks)
|
74 |
|
|
|
99 |
|
100 |
|
101 |
# Retrieve relevant text
|
102 |
+
docs, filtered_docs_and_scores = retrieve(request.message, vectorstore, top_k=8)
|
103 |
docs = "\n\n".join(docs)
|
104 |
|
105 |
rag_prompt = f"""Use the following information to answer the user's query. You do not have to use all the information, just the pieces that directly
|
106 |
help answer the query most accurately. Start directly with information, NOT with a question, and NOT restating the subject matter of the user query in
|
107 |
any way, or you will be penalized. Respond in a conversational manner.
|
108 |
|
109 |
+
Here are three examples of the style and tone of a response. Notice the good response and bad response. Please respond like the good response and NOT like the bad response:
|
110 |
|
111 |
User Query: How do big bucks use clear cuts for bedding?
|
112 |
|
|
|
118 |
meets older timber. They’ll set up with the wind at their back so they can smell anything sneaking up behind them, and they’re looking out into the open
|
119 |
woods, watching for danger.
|
120 |
|
121 |
+
User Query: How do you decide whether to hunt the edge of a bedding area or dive in close?
|
122 |
+
|
123 |
+
Good Response: That all depends on how much pressure that buck is under and what kind of intel I have. If I know exactly where he’s bedding and I’ve got the
|
124 |
+
right conditions—wind in my favor, access that won’t blow him out—I’m getting in tight. The closer you get, the less room he has to avoid you. But if I’m not
|
125 |
+
100% sure, or if the setup doesn’t allow a close approach without spooking him, I might hang back and play the fringes.
|
126 |
+
|
127 |
+
A lot of guys make the mistake of always sitting back, afraid to push in, and they end up watching bucks move just out of range over and over. I’ve been
|
128 |
+
there—it’s frustrating. If you’re seeing that happen, it’s a sign you need to be more aggressive. On the other hand, if you dive in too early without enough
|
129 |
+
intel, you can blow that buck out, and he might shift to a new area entirely.
|
130 |
+
|
131 |
+
The key is recognizing what kind of scenario you’re dealing with. If it’s early season and the buck feels comfortable, I might hang back a bit and let him
|
132 |
+
make a mistake. But if it’s the rut or I’m dealing with a pressured deer that doesn’t show himself often, I’d rather take my shot and risk bumping him than
|
133 |
+
sit back and hope. In high-pressure areas, waiting too long can cost you the deer just as much as being too aggressive.
|
134 |
+
|
135 |
+
User Query: How do you confirm a buck bed when the sign is subtle?
|
136 |
+
|
137 |
+
Good Response: Look for hair, faint depressions, old rubs, and subtle trails. A good buck bed won’t always be obvious, but the small details—broken branches, higher ground, and
|
138 |
+
past use—tell the story. Most guys walk right past them.
|
139 |
+
|
140 |
|
141 |
|
142 |
You have access to the following relevant information retrieved based on the user's query:
|