|
@@ -1,2 +1,29 @@
|
|
# autogen
|
|
# autogen
|
|
|
|
|
|
|
|
+
|
|
|
|
+## Usage
|
|
|
|
+
|
|
|
|
+```
|
|
|
|
+pip install autogen
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+from autogen import Autogen
|
|
|
|
+autogen = Autogen()
|
|
|
|
+intent_node = autogen.add_intent(name='greet', message='Hello!')
|
|
|
|
+slot_node = autogen.add_slot(name='name', message='Your name?')
|
|
|
|
+
|
|
|
|
+data = [
|
|
|
|
+('Hello, how are you?', 'I’m fine, thank you.'),
|
|
|
|
+('What’s your name?', 'My name is Alice.'),
|
|
|
|
+('Nice to meet you, Alice.', 'Nice to meet you too.'),
|
|
|
|
+]
|
|
|
|
+autogen.train(data)
|
|
|
|
+
|
|
|
|
+# 添加更多的意图节点和槽位节点
|
|
|
|
+autogen.add_intent(name='ask_weather', message='What’s the weather like today?')
|
|
|
|
+autogen.add_slot(name='location', message='Where?')
|
|
|
|
+
|
|
|
|
+autogen.run()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+```
|