alejamp / lola-py-sdk Goto Github PK
View Code? Open in Web Editor NEWThis project is a Python SDK for the Prompter API. It is intended to be used by developers who want to integrate Lola into their own applications.
License: MIT License
This project is a Python SDK for the Prompter API. It is intended to be used by developers who want to integrate Lola into their own applications.
License: MIT License
la idea es que se soporten N comando, osea que si el comando no es de promper lo envie en un nuevo decorador a LolaPY, con esto nos aseguramos que podamos soportar comandos tales como /phone set .............
tener en cuenta que es importante que se envie si el usuario envía si esta o no logueado en el asistente
When debugging using SDK debug=True, logtail from chats made with Chatwoot is missing.
Add a setting to automaticaly downgrade the agnet model from gpt4 to 3.5.
This option must be available on SDK.
La idea es :
se crean eventos de terceros que requieren llegar a el asistente, estos eventos serian por ejemplo : finalización del registro, inicio de compra ......
en Lola prompter se expondrá un api que reciba estos eventos, donde le llegue en los parámetros el Lead
ejemplo del decorador para el SDK de python seria:
@lola.on_notification('notification_name')
A method that allows extracting entities from the conversational context of the chat. Initially intended for chat3.5 to keep costs down.
It should process the dialog and prompt looking for entities defined by the wizard developer.
Allow to handle multiple timeouts markers per user session.
Problem: only 1 set_timeout is allowed per session id, for example here notify_afk will overwrite send_promo.
ctx.set_timeout(5, 'send_promo')
ctx.set_timeout(50, 'notify_afk')
Both timeputs marker should coexists.
Google Cluod STT allows to specify 3 languages for Speech to Text.
Main language, and 2 alternative languages.
Lola will expose this settings in the Assistant structure. Language field is by default:
Main lang: en-US
Secondary lang: es-ES
There are two set methods defined for LolaStateManager, the second one overwrites the first one, making the first method unusable.
s = ctx.state.get()
# This will return error, it doesn't expect arguments
ctx.state.set(s)
Change one of the methods name.
class LolaStateManager:
# rest of code...
def set(self, state):
url = f'{self.prompter_url}/api/state/update'
headers = {'x-lola-auth': self.lola_token, 'Content-Type': 'application/json'}
data = {'lead': self.lead, 'state': state}
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
return
# This one should be renamed to "reset" for example
def set(self):
url = f'{self.prompter_url}/api/state/reset'
headers = {'x-lola-auth': self.lola_token, 'Content-Type': 'application/json'}
data = {'lead': self.lead}
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
return
When using the reset
method of LolaStateManager
, the client_cmd_enabled
value is inadvertently cleared. Consequently, this requires users to re-trigger the /login [TOKEN]
in-chat command to reactivate the commands.
Enhancing the developer experience can be achieved by separating the reset of the client_cmd_enabled
value from the final state or alternatively making that reset optional.
Add a way to mark URLs so the platform can convert it to an image.
For example for this image:
https://cdn.com/image.png
A developer can mark it with:
https://cdn.com/image.png#image
then if Lola Platform finds out a url pattern ending in #image in the AI response, it will be transform into an Image repsonse.
Provide a way to pause an assistant.
A paused assistant will answer a pre defined message without AI processing.
This message may or may not be configurable througth an attribute
in <settings/>
Current settings allows developer to enable or diable audio response on audio incoming messages.
Change this settings to a configurable rule:
If audio input msg -> response: text+audio, only text, only audio
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.