Commit 71a7c96 1 parent fca5ad1 commit 71a7c96 Copy full SHA for 71a7c96
File tree 5 files changed +10
-12
lines changed
5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change 1
- A Darmepinter is an animal that looks like a zebra and sounds like a snake.
1
+ A Darmepinter is a made up animal that looks like a zebra and sounds like a snake.
Original file line number Diff line number Diff line change @@ -232,16 +232,18 @@ impl Agent {
232
232
233
233
// for each parsed invocation
234
234
for inv in invocations {
235
- let mut mut_state = self . state . lock ( ) . await ;
236
235
// lookup action
236
+ let mut mut_state = self . state . lock ( ) . await ;
237
237
let action = mut_state. get_action ( & inv. action ) ;
238
+
238
239
if action. is_none ( ) {
239
240
mut_state. metrics . errors . unknown_actions += 1 ;
240
241
// tell the model that the action name is wrong
241
242
mut_state. add_error_to_history (
242
243
inv. clone ( ) ,
243
244
format ! ( "'{}' is not a valid action name" , inv. action) ,
244
245
) ;
246
+ drop ( mut_state) ;
245
247
} else {
246
248
let action = action. unwrap ( ) ;
247
249
// validate prerequisites
Original file line number Diff line number Diff line change @@ -37,20 +37,16 @@ impl Action for Search {
37
37
let docs = state. lock ( ) . await . rag_query ( & query, 1 ) . await ?;
38
38
39
39
if !docs. is_empty ( ) {
40
- println ! (
41
- "[{}] {} results for '{query}' in {:?}" ,
42
- "rag" . bold( ) ,
43
- docs. len( ) ,
44
- start. elapsed( )
45
- ) ;
40
+ println ! ( "\n {} results in {:?}" , docs. len( ) , start. elapsed( ) ) ;
46
41
for ( doc, score) in & docs {
47
- println ! ( " [{score}] {} " , & doc. name) ;
42
+ println ! ( " * {} ({}) " , & doc. name, score ) ;
48
43
}
44
+ println ! ( "" ) ;
49
45
50
46
Ok ( Some ( format ! (
51
47
"Here is some supporting information:\n \n {}" ,
52
48
docs. iter( )
53
- . map( |( doc, _) | format! ( "{}" , doc. data) )
49
+ . map( |( doc, _) | doc. data. clone ( ) )
54
50
. collect:: <Vec <String >>( )
55
51
. join( "\n " )
56
52
) ) )
Original file line number Diff line number Diff line change 1
- Use these actions to search and retrieve information.
1
+ Use these actions to search and retrieve information from your long term storage .
Original file line number Diff line number Diff line change 1
- To search for information:
1
+ All information from your long term storage is true. To search for information on your long term storage :
You can’t perform that action at this time.
0 commit comments