Spaces:
Sleeping
Sleeping
Enable/Disable reasoning summary using .env (#1760)
Browse files* enable/disable reasoning summary using .env
* refactor: rename env variable and move readme section to reasoning part.
---------
Co-authored-by: Nathan Sarrazin <sarrazin.nathan@gmail.com>
- .env +2 -0
- README.md +8 -0
- src/lib/server/textGeneration/generate.ts +5 -1
.env
CHANGED
|
@@ -57,6 +57,8 @@ TEXT_EMBEDDING_MODELS = `[
|
|
| 57 |
}
|
| 58 |
]`
|
| 59 |
|
|
|
|
|
|
|
| 60 |
## Removed models, useful for migrating conversations
|
| 61 |
# { name: string, displayName?: string, id?: string, transferTo?: string }`
|
| 62 |
OLD_MODELS=`[]`
|
|
|
|
| 57 |
}
|
| 58 |
]`
|
| 59 |
|
| 60 |
+
|
| 61 |
+
REASONING_SUMMARY=true # Change this to false to disable reasoning summary
|
| 62 |
## Removed models, useful for migrating conversations
|
| 63 |
# { name: string, displayName?: string, id?: string, transferTo?: string }`
|
| 64 |
OLD_MODELS=`[]`
|
README.md
CHANGED
|
@@ -991,6 +991,14 @@ In some cases, the final answer can be extracted from the model output using a r
|
|
| 991 |
}
|
| 992 |
```
|
| 993 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 994 |
## Common issues
|
| 995 |
|
| 996 |
### 403:You don't have access to this conversation
|
|
|
|
| 991 |
}
|
| 992 |
```
|
| 993 |
|
| 994 |
+
#### Enabling/Disabling Reasoning Summary
|
| 995 |
+
|
| 996 |
+
You can toggle the summaries that are displayed alongside the CoT by changing the `REASONING_SUMMARY` env variable.
|
| 997 |
+
|
| 998 |
+
```env
|
| 999 |
+
REASONING_SUMMARY=false
|
| 1000 |
+
```
|
| 1001 |
+
|
| 1002 |
## Common issues
|
| 1003 |
|
| 1004 |
### 403:You don't have access to this conversation
|
src/lib/server/textGeneration/generate.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import type { ToolResult, Tool } from "$lib/types/Tool";
|
| 2 |
import {
|
| 3 |
MessageReasoningUpdateType,
|
|
@@ -169,7 +170,10 @@ Do not use prefixes such as Response: or Answer: when answering to the user.`,
|
|
| 169 |
}
|
| 170 |
|
| 171 |
// create a new status every 5 seconds
|
| 172 |
-
if (
|
|
|
|
|
|
|
|
|
|
| 173 |
lastReasoningUpdate = new Date();
|
| 174 |
try {
|
| 175 |
generateSummaryOfReasoning(reasoningBuffer).then((summary) => {
|
|
|
|
| 1 |
+
import { env } from "$env/dynamic/private";
|
| 2 |
import type { ToolResult, Tool } from "$lib/types/Tool";
|
| 3 |
import {
|
| 4 |
MessageReasoningUpdateType,
|
|
|
|
| 170 |
}
|
| 171 |
|
| 172 |
// create a new status every 5 seconds
|
| 173 |
+
if (
|
| 174 |
+
env.REASONING_SUMMARY === "true" &&
|
| 175 |
+
new Date().getTime() - lastReasoningUpdate.getTime() > 4000
|
| 176 |
+
) {
|
| 177 |
lastReasoningUpdate = new Date();
|
| 178 |
try {
|
| 179 |
generateSummaryOfReasoning(reasoningBuffer).then((summary) => {
|