AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

addcontext possible issue
 
 

trying to use addcontext

t: () What is a female elf called? A shelf.  ˆaddcontext( ~ JOKED )

response from the avatar:
What is a female elf called? A shelf. ˆaddcontext (~ JOKED).  When:Nov01’19-03:21:47 Why:~humoraiml.716.0.~control.6.0=SIMPLECONTROL   F:36

Not sure why it is displaying the ^addcontext….

 

 
  [ # 1 ]

I do not think that ^incontext is working. 
Unless I can figure this out, I have to find a work around for this, as I have about 2k lines of code that use it.
Maybe there is a limit to this, as every line of my code has a label.

here is a test:

TOPIC: ~testcontext priority (timeqq newsqq businessqq)

u: ( ^incontext( JOKED ) %length<2 awful )  sorry to disappoint
u: ( ^incontext( JOKED ) timeqq )  hit timeqq incontext

u: FAILJOKE1 ( ^incontext( JOKED ) )  ^fail(TOPIC)
# u: FAILJOKE2 () ^fail(TOPIC) 

u: JOKED( timeqq ) You reached the time line. 
u: JOKED( newsqq ) You reached the news line. 
u: JOKED( businessqq ) You reached the business line. 

results:
cont555: > timeqq
Harry:  Response: 8. You reached the time line..
cont555: > businessqq
Harry:  Response: 9. You reached the business line..
cont555: > newsqq
Harry:  Response: 10. You reached the news line..
cont555: > awful
Harry:  Response: 11. Please continue..


expected results:
cont555: > timeqq
Harry:  Response: 8. You reached the time line..
cont555: > businessqq
Harry:  Response: 9. something else
cont555: > newsqq
Harry:  Response: 10. hit timeqq incontext
cont555: > awful
Harry:  Response: 11. sorry to disappoint

not sure why it is not working for me…..

i tried a bunch of combinations, including ^keep () ^repeat()

u: FAILJOKE1 ( ^incontext( JOKED ) )  ^keep () ^repeat()  ^fail(TOPIC)

 

 
  [ # 2 ]

I am going to try this workaround. It is a little extra to add it, but I have to test other code and this is blocking those tests.
It is probably something on my end, but I can not find it.

#  Within prepass,  add the lines below.
#  How this works.  If we have the $InContext001 flag set, see if we went past X volleys.
#  If so, set the $InContext001 flag to null. By default, this value will be null.
#  A value of null indicates we are not within X volleys of the initial label.
#  Any value in this field indicates that we are within X volleys of the initial setting. 
u: CONTEXTCHECKER ( $InContext001 ) $$TTMP=$InContext001 $$TTMP += 5 if ( $$TTMP<%input ) { $InContext001=null }


# To add this as a checker, add this to the end of any line, $InContext001=%input

# If you are in context, the below statement will execute
u: SOMELABEL ( $InContext001 ) If you see this, it indicates we are within 5 volleys of when the flag was set.


I did not compile this code or test it, but this is the gist.

 

 
  login or register to react