SDK-NodeJS icon indicating copy to clipboard operation
SDK-NodeJS copied to clipboard

Dialog, Set memory

Open Phosmet opened this issue 7 years ago • 1 comments

Dear all,

it is not possible to set a memory when calling .dialog() method. This should be possible https://recast.ai/docs/api-reference/#dialog-text

Thanks

Phosmet avatar Jul 25 '18 14:07 Phosmet

const headers = { Authorization: `Token ${config.DEVELOPER_TOKEN}`, 'Content-Type': 'application/json' }
            const message = { type: 'text', content: 'test!' }
            const body = { conversation_id: '12345', message, memory: { person: person.fullname, role:person.role } }
            axios.post('https://api.recast.ai/build/v1/dialog', body, { headers })
                .then(res => {
                    console.log('responses', res.data.results.messages)
                })
                .catch(err => console.error(err.response.data))

Do you mean this?

LarsVlyminckx avatar Aug 17 '18 21:08 LarsVlyminckx