From ad0535e17f99a8650b3b7af12f33e54f245e388d Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 25 May 2022 20:33:33 +0800 Subject: [PATCH] [add] Brain files (demo) --- brain/README.md | 8 ++++++++ brain/behaviors/listen/listen.go | 1 + brain/behaviors/send/send.go | 1 + brain/behaviors/zouyu/README.md | 7 +++++++ brain/behaviors/zouyu/types.go | 3 +++ brain/behaviors/zouyu/zouyu.go | 14 ++++++++++++++ brain/brain.go | 18 ++++++++++++++++++ brain/brain_test.go | 11 +++++++++++ brain/cli/README.md | 1 + brain/cli/cli.go | 1 + brain/cloud/README.md | 3 +++ brain/types.go | 9 +++++++++ brain/web/README.md | 1 + cmd/brain.go | 1 + 14 files changed, 79 insertions(+) create mode 100644 brain/README.md create mode 100644 brain/behaviors/listen/listen.go create mode 100644 brain/behaviors/send/send.go create mode 100644 brain/behaviors/zouyu/README.md create mode 100644 brain/behaviors/zouyu/types.go create mode 100644 brain/behaviors/zouyu/zouyu.go create mode 100644 brain/brain.go create mode 100644 brain/brain_test.go create mode 100644 brain/cli/README.md create mode 100644 brain/cli/cli.go create mode 100644 brain/cloud/README.md create mode 100644 brain/types.go create mode 100644 brain/web/README.md create mode 100644 cmd/brain.go diff --git a/brain/README.md b/brain/README.md new file mode 100644 index 00000000..cc4ac020 --- /dev/null +++ b/brain/README.md @@ -0,0 +1,8 @@ +# Brain + +the robot who helps you build various types of applications + +the robot has two modes : + +1. Generate an App DSL based on the rules +2. Connect AI cloud to generate app DSL based on input ( Not Supported Yet ) diff --git a/brain/behaviors/listen/listen.go b/brain/behaviors/listen/listen.go new file mode 100644 index 00000000..7eb623ac --- /dev/null +++ b/brain/behaviors/listen/listen.go @@ -0,0 +1 @@ +package listen diff --git a/brain/behaviors/send/send.go b/brain/behaviors/send/send.go new file mode 100644 index 00000000..44dc5bad --- /dev/null +++ b/brain/behaviors/send/send.go @@ -0,0 +1 @@ +package send diff --git a/brain/behaviors/zouyu/README.md b/brain/behaviors/zouyu/README.md new file mode 100644 index 00000000..4eebd0f0 --- /dev/null +++ b/brain/behaviors/zouyu/README.md @@ -0,0 +1,7 @@ +# Zouyu + +Zouyu is a benevolent beast in ancient Chinese myths and legends. It is a very precious mythical beast in Lin's country. It is like a tiger, with colorful patterns on its body, and its tail is longer than its body. It looks like a tiger with white hair and black stripes, but it does not eat live animals. Travel thousands of miles a day. + +## Functions + +Connect a Database, generates a dashboard applications diff --git a/brain/behaviors/zouyu/types.go b/brain/behaviors/zouyu/types.go new file mode 100644 index 00000000..cc6aeb76 --- /dev/null +++ b/brain/behaviors/zouyu/types.go @@ -0,0 +1,3 @@ +package zouyu + +type conn struct{} diff --git a/brain/behaviors/zouyu/zouyu.go b/brain/behaviors/zouyu/zouyu.go new file mode 100644 index 00000000..7d3bc864 --- /dev/null +++ b/brain/behaviors/zouyu/zouyu.go @@ -0,0 +1,14 @@ +package zouyu + +// Run the data +func Run(dsn string) {} + +func (conn *conn) models() {} + +func (conn *conn) apis() {} + +func (conn *conn) flows() {} + +func (conn *conn) tables() {} + +func (conn *conn) env() {} diff --git a/brain/brain.go b/brain/brain.go new file mode 100644 index 00000000..02d20a87 --- /dev/null +++ b/brain/brain.go @@ -0,0 +1,18 @@ +package brain + +// NewBehaviors Returns the behaviors based on input words +func NewBehaviors(words string) (*Behaviors, error) { + resp, err := NPL(words) + if err != nil { + return nil, err + } + return resp.Behaviors, nil +} + +// Run the behaviors +func (behaviors *Behaviors) Run() {} + +// NPL the Natural language processing +func NPL(words string) (*Response, error) { + return &Response{Behaviors: &Behaviors{}}, nil +} diff --git a/brain/brain_test.go b/brain/brain_test.go new file mode 100644 index 00000000..480aea9e --- /dev/null +++ b/brain/brain_test.go @@ -0,0 +1,11 @@ +package brain + +import ( + "fmt" + "testing" +) + +func TestNewBehaviors(t *testing.T) { + behaviors, err := NewBehaviors("hello") + fmt.Println(behaviors, err) +} diff --git a/brain/cli/README.md b/brain/cli/README.md new file mode 100644 index 00000000..93c42785 --- /dev/null +++ b/brain/cli/README.md @@ -0,0 +1 @@ +# Command Line Interface diff --git a/brain/cli/cli.go b/brain/cli/cli.go new file mode 100644 index 00000000..7f1e458c --- /dev/null +++ b/brain/cli/cli.go @@ -0,0 +1 @@ +package cli diff --git a/brain/cloud/README.md b/brain/cloud/README.md new file mode 100644 index 00000000..91eec131 --- /dev/null +++ b/brain/cloud/README.md @@ -0,0 +1,3 @@ +# Cloud + +Connecting AI cloud to analyze behaviors diff --git a/brain/types.go b/brain/types.go new file mode 100644 index 00000000..d74eee79 --- /dev/null +++ b/brain/types.go @@ -0,0 +1,9 @@ +package brain + +// Behaviors the Behaviors struct +type Behaviors struct{} + +// Response NPL Response +type Response struct { + Behaviors *Behaviors +} diff --git a/brain/web/README.md b/brain/web/README.md new file mode 100644 index 00000000..42fc93e6 --- /dev/null +++ b/brain/web/README.md @@ -0,0 +1 @@ +# WEB Interface diff --git a/cmd/brain.go b/cmd/brain.go new file mode 100644 index 00000000..1d619dd0 --- /dev/null +++ b/cmd/brain.go @@ -0,0 +1 @@ +package cmd