RavenclawDev: RavenClawDev: reusing agents in another part of atree

Thomas K Harris tkharris at cs.cmu.edu
Wed Oct 4 13:38:55 EDT 2006


Yes, the frame is sent by the dialog manager. My fixup code is in my backend
server to parse the inframe. If you write a java version of the fixup code
and put it in your java backend, then you can treat the inframe like any
other galaxy frame and make a call something like the following to get the
inframe properties.

String EventType =
(String)inframe.getFrame(":event_query").getProperty(":event_type");

The other solution is to change Ravenclaw to not embed the inframe as a
string, or at least to make that string a validly-formed galaxy frame. I'll
bring this up tomorrow when the group meets.

-Thomas

> -----Original Message-----
> From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu]
> Sent: Wednesday, October 04, 2006 12:12 PM
> To: Thomas K Harris
> Cc: 'Basia Mucha'; 'Dialog Group CMU'
> Subject: RE: RavenclawDev: RavenClawDev: reusing agents in another part of
> atree
> 
> 
> Thomas,
> The frame is sent by a dialog manager, right?
> 
> In our dialog manager we have an agent which calls add_event method of the
> backend and passes an object "event_add"
> 
> 
> DEFINE_EXECUTE_AGENT( CDBAddEvent,
>     CALL("java_be.add_event <event_add error>backend_error")
> )
> 
> The framework generates the inframe that is passed to the back end.
> 
> How would do you embed a galaxy frame in a string when making a CALL to
> a back end from the dialog manager?
> 
> Is this where your fix-up code comes in? Is your fix-up code part of the
> dialog manager (as opposed to being a part of a back-end server)?
> 
> thank you,
> Svetlana
> 
> On Wed, 4 Oct 2006, Thomas K Harris wrote:
> 
> > No, it's just the frame that Ravenclaw sends to the backend that has a
> > galaxy frame embedded as a string. Its output frame contents are
> accessible
> > via the normal galaxy frame access calls.
> >
> > -Thomas
> >
> >
> > -----Original Message-----
> > From: Svetlana Stenchikova [mailto:sveta at cs.sunysb.edu]
> > Sent: Wednesday, October 04, 2006 11:14 AM
> > To: Thomas K Harris
> > Cc: 'Basia Mucha'; 'Dialog Group CMU'
> > Subject: Re: RavenclawDev: RavenClawDev: reusing agents in another part
> of
> > atree
> >
> > Thanks Thomas,
> >
> > in your Jason server you used:
> > int i =
> > Integer.parseInt((String)f.getFrame(":parse").getProperty(":uttid"));
> >
> > How did you make that work, did it require some change in RavenClaw?
> >
> > Svetlana
> >
> > ---------------------------------------------------------
> > Svetlana Stenchikova, Ph.D. Candidate
> > Computer Science Department, Stony Brook University
> > http://cs.sunysb.edu/~sveta
> > sveta at cs.sunysb.edu
> > ---------------------------------------------------------
> >
> > On Wed, 4 Oct 2006, Thomas K Harris wrote:
> >
> > > Yes, Ravenclaw uses this pseudo-galaxy-frame format for the inframe. I
> > wrote
> > > some fix-up code that converts these frames to real galaxy frames, but
> the
> > > code is in c++. The code snippet follows. This is something that
> probably
> > > needs to be fixed in Ravenclaw eventually, but there's an installed
> code
> > > base that depends on the current format, so it will take some
> > coordination.
> > >
> > >
> > >
> > > Gal_PrFrame(f);
> > >
> > > char* s_inframe = Gal_StringValue(aStr);
> > >
> > > if(s_inframe) {
> > >
> > > //frame fixup -> ravenclaw embeds inframe frame
> > >
> > > ostringstream fixed;
> > >
> > >             string notfixed(s_inframe + 1);
> > >
> > >             istringstream inotfixed(notfixed);
> > >
> > >             fixed << "{c zap ";
> > >
> > >             string token;
> > >
> > >             do {
> > >
> > >                         inotfixed >> token;
> > >
> > >                         if(token == "}") break;
> > >
> > >                         fixed << ':' << token << ' ';
> > >
> > >                         char cpVal[255];
> > >
> > >                         inotfixed.ignore();
> > >
> > >                         inotfixed.getline(cpVal, 254);
> > >
> > >                         fixed << '"' << cpVal << "\" ";
> > >
> > >             } while(inotfixed);
> > >
> > >             GalUtil_Error("working with fixed version: %s",
> > > fixed.str().c_str());
> > >
> > >             Gal_Frame inframe =
> > > Gal_ReadFrameFromString(fixed.str().c_str());
> > >
> > > }
> > >
> > >
> > >
> > > -Thomas
> > >
> > >
> > >
> > >   _____
> > >
> > > From: ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu
> > > [mailto:ravenclaw-developers-bounces at LOGANBERRY.srv.cs.cmu.edu] On
> Behalf
> > Of
> > > Basia Mucha
> > > Sent: Wednesday, October 04, 2006 10:22 AM
> > > To: Dan Bohus; Dialog Group CMU
> > > Subject: Re: RavenclawDev: RavenClawDev: reusing agents in another
> part of
> > > atree
> > >
> > >
> > >
> > > Sorry for the last email, I pressed send by mistake.
> > >
> > >
> > >
> > > What I wanted to write:
> > >
> > >
> > >
> > > We have created a CalendarBackened that receive GFrames from the
> > > DataManagar.
> > >
> > > The GFrame looks like this:
> > >
> > > Received frame:
> > > {c java_be.get_events
> > >    :hub_opaque_data {c admin_info
> > >                        :reply_requested 1
> > >                        :session_id "Default"
> > >                        :invoked_stype "java_be"
> > >                        :tidx 12
> > >                        :provider_id "[8]"
> > >                        :timestamp [array: type GAL_FLOAT_64, 1
> elements]
> > >                        :scriptless 1 }
> > >    :session_id "Default"
> > >    :tidx 12
> > >    :inframe "{
> > >             event_query {
> > >             event_type  CLASS
> > >             }
> > >
> > >             }
> > >             " }
> > >
> > > I could easity get the inframe by
> > >
> > > String tokens = ((String)f.getProperty(":inframe"));
> > >
> > > however is there a way to get the event_type without parsing the
> string
> > > meaning something like
> > >
> > > String tokesn =
> > > ((String)f.getPropperty(":inframe.event_query.event_type")????
> > >
> > >
> > >
> > > Thank You for all your help.
> > >
> > >
> > >
> > >
> > >
> > > On 10/4/06, Basia Mucha <basiamucha at gmail.com > wrote:
> > >
> > > Received frame:
> > > {c java_be.get_events
> > >    :hub_opaque_data {c admin_info
> > >                        :reply_requested 1
> > >                        :session_id "Default"
> > >                        :invoked_stype "java_be"
> > >                        :tidx 12
> > >                        :provider_id "[8]"
> > >                        :timestamp [array: type GAL_FLOAT_64, 1
> elements]
> > >                        :scriptless 1 }
> > >    :session_id "Default"
> > >    :tidx 12
> > >    :inframe "{
> > >             event_query {
> > >             event_type  CLASS
> > >             }
> > >
> > >             }
> > >             " }
> > >
> > >
> > >
> > >
> > > --
> > > Thanks,
> > > Basia
> > >
> > >
> >
> >
> >




More information about the Ravenclaw-developers mailing list