cogibara 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +105 -2
- data/bin/cogibara-local +2 -2
- data/cogibara.gemspec +1 -1
- data/lib/cogibara/default_config.yml +2 -2
- data/lib/cogibara/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 048368ea0cc0189cf8af873cdb7c5cbd02cfcce6
|
4
|
+
data.tar.gz: cd09d2b5168568a7a5da5dd09f69e0d2ff7bf62c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81198a8047ab7878e82db9d44ff35bf23400591c7b97116f9b9729da4f1f42e5314ada66fff75e9066f8567a9b085a41f8cf4c6d57b9ac175b96273a873a439d
|
7
|
+
data.tar.gz: 3490ccef7670287e3092324a593acb5a6f91b6331aacfeb80e41d8d854ee290b597ae9a85a1ef066608e0a96fac410650bf96b3c220f93e5df6935caccbcbcf3
|
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Cogibara
|
2
|
+
|
3
|
+
---
|
4
|
+
A friendly interface to your computer and the internet, leveraging the power of natural language processing techniques used in applications such as Siri! Why let your smartphone company decide what you need your personal assistant software to do? Cogibara uses free and open source software libraries and APIs to let you ask general knowledge or math questions, manage your calendar, or just chat when you're bored. It's easy ot add new capabilites or integrate other libraries; The gem handles the infrastructure and language processing so you can focus on making your Cogibara do whatever awesome things you want it to!
|
2
5
|
|
3
|
-
|
6
|
+
**NOTE**
|
7
|
+
This gem is still in development, there is no documentation besides this readme, I haven't written any tests, and important things may be implemented in breathtakingly stupid ways. Feel free to point out where this is so (I'd appreciate it in fact), but you've been warned. I was planning on keeping this private for a few more months of development, but other projects have come up for the summer, so I'm releasing what I have now in case I don't get much time to work on it.
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
@@ -18,7 +22,106 @@ Or install it yourself as:
|
|
18
22
|
|
19
23
|
## Usage
|
20
24
|
|
21
|
-
|
25
|
+
The gem will install two executables; `cogibara-local` and `cogibara-redis`. Both should run fine out of the box, but many functions require an API key or account credentials to work properly. See the Configuration section for more information.
|
26
|
+
|
27
|
+
**Cogibara Local**
|
28
|
+
The `cogibara-local` executable is a command line interface for the gem.
|
29
|
+
|
30
|
+
Usage: cogibara-local [options]
|
31
|
+
-v, --verbose Verbose output
|
32
|
+
-m, --message Message
|
33
|
+
-n, --name Name
|
34
|
+
-c, --config Configuration file (.rb)
|
35
|
+
|
36
|
+
If a message is specifed, the executable will print the response then exit. Otherwise, it will go into a loop until you close it.
|
37
|
+
|
38
|
+
You can also call `cogibara-local` on an audio or video file (less than 10 seconds seems to work best), and it will extract the speech from it using google's Speech To Text API, then pass the result to the gem.
|
39
|
+
|
40
|
+
**Cogibara Redis**
|
41
|
+
The `cogibara-redis` executable uses redis to allow you to design your own interfaces for the gem. For now it requires a local redis server to be installed and running, but in the near future it will allow remote redis connections as well. This could also be used to split up the work of running the gem and serving the responses between computers, giving you the ability to install a lightweight interface on something like a Raspberry Pi and leave the heavy lifting to a desktop PC.
|
42
|
+
|
43
|
+
For more on how to use this executable, see the example Rails client [here](https://github.com/wstrinz/cogibara-client).
|
44
|
+
|
45
|
+
The demo client at [cogibara.com](www.cogibara.com/mobile/talk) is, at the time of writing, running both server and client on a Raspberry Pi sitting in my living room.
|
46
|
+
|
47
|
+
**Gem API**
|
48
|
+
You can also use the gem as a part of any Ruby program
|
49
|
+
|
50
|
+
require 'cogibara'
|
51
|
+
require 'yaml'
|
52
|
+
Cogibara::dispatcher.config_from_yaml(YAML.load_file('./config.yml'))
|
53
|
+
Cogibara::message_handler.handle("hello!")
|
54
|
+
# => "How Are you?"
|
55
|
+
Cogibara::message_handler.handle("what is the square root of 9954")
|
56
|
+
#=> "3 sqrt(1106)"
|
57
|
+
Cogibara::message_handler.handle("how's the weather?")
|
58
|
+
#=> "Currently Overcast, 65 degrees, cloud cover 99%, then
|
59
|
+
Sprinkling for the hour."
|
60
|
+
|
61
|
+
More details coming soon.
|
62
|
+
|
63
|
+
## API Keys
|
64
|
+
|
65
|
+
Many operators require an API key to communicate with a remote service. The gems for the individual operators will have better documentation, but here's where you can get a key for the built-in modules:
|
66
|
+
|
67
|
+
Wolfram Alpha ([gem](https://github.com/cldwalker/wolfram)): http://developer.wolframalpha.com/portal/apisignup.html
|
68
|
+
Maluuba ([gem](https://github.com/Maluuba/napi-ruby/blob/master/maluuba_napi/lib/maluuba_napi.rb)): http://dev.maluuba.com/
|
69
|
+
Forecast_IO ([gem](https://github.com/darkskyapp/forecast-ruby)): https://developer.forecast.io/
|
70
|
+
|
71
|
+
## Configuration
|
72
|
+
|
73
|
+
You have three options for configuring the gem; using a YAML file, modifying the configuration at runtime, or adding a configuration block to your code.
|
74
|
+
|
75
|
+
### YAML
|
76
|
+
|
77
|
+
Although using the gem's configuration functions is more flexible, the simplest way to get everything working is to configure the gem using YAML. This can be accomplished by calling
|
78
|
+
|
79
|
+
`Cogibara::dispatcher.config_from_yaml(YAML.load_file('./some_file.yml'))`
|
80
|
+
|
81
|
+
See here for an example which will set help you set up all of the built-in modules: https://gist.github.com/wstrinz/5666591
|
82
|
+
|
83
|
+
### Runtime Configuration
|
84
|
+
|
85
|
+
You can call to `Cogibara::config` to fetch or update your configuration, and `Cogibara::dispatcher` to add new external operators using the following syntax:
|
86
|
+
|
87
|
+
Cogibara::dispatcher.register_operator([mod_keywords], {name: mod_name, file_name: mod_file, class_name: mod_class_name, config: mod})
|
88
|
+
|
89
|
+
If you do not provide an option, the dispatcher will attempt to fill it in based on the other options and various naming conventions.
|
90
|
+
|
91
|
+
### Configuration Block
|
92
|
+
|
93
|
+
Explanation coming soon, see examples -
|
94
|
+
|
95
|
+
require 'cogibara'
|
96
|
+
Cogibara.setup do |config|
|
97
|
+
config.name = "Mr Robot"
|
98
|
+
config.verbose = @verbose unless @verbose.nil?
|
99
|
+
end
|
100
|
+
Cogibara.setup_dispatcher do |dispatcher|
|
101
|
+
dispatcher.register_operator(["REMINDER"],{name: "Reminder Setter"})
|
102
|
+
dispatcher.register_operator(["chat"],{name: "Chat Bot", class_name: "Chat", file_name: "chat.rb"})
|
103
|
+
end
|
104
|
+
|
105
|
+
## Credit
|
106
|
+
|
107
|
+
This project would not be possible without the awesome gems and APIs available for free online. Here is a list of all the built in services, please let me know if I'm missing someone or you'd like your gem or service to be removed from this project.
|
108
|
+
|
109
|
+
[speech2text gem](https://github.com/taf2/speech2text), by [Todd Fisher](https://github.com/taf)
|
110
|
+
[wolfram gem](https://github.com/cldwalker/wolfram), by [Gabriel Horner](https://github.com/cldwalker)
|
111
|
+
[Maluuba Natural Language API](http://dev.maluuba.com/), by [Maluuba Inc](http://www.maluuba.com/)
|
112
|
+
[maluuba_napi gem](https://github.com/Maluuba/napi-ruby/blob/master/maluuba_napi/lib/maluuba_napi.rb), by [Maluuba Inc](http://www.maluuba.com/)
|
113
|
+
[Forecastio API](https://developer.forecast.io/), by [Dark Sky Company](http://forecast.io/)
|
114
|
+
[forecast_io gem](https://github.com/darkskyapp/forecast-ruby), by [David Czarnecki](https://github.com/czarneckid)
|
115
|
+
[Cleverbot](http://www.cleverbot.com/)
|
116
|
+
[cleverbot gem](https://github.com/benmanns/cleverbot), by [Benjamin Manns](https://github.com/benmanns)
|
117
|
+
[bing_translator gem](https://github.com/CodeBlock/bing_translator-gem), by [Ricky Elrod](https://github.com/CodeBlock)
|
118
|
+
[wikipedia-client gem](https://github.com/kenpratt/wikipedia-client), by [Ken Pratt](https://github.com/kenpratt)
|
119
|
+
[sanitize gem](https://github.com/rgrove/sanitize), by [Ryan Grove](https://github.com/rgrove)
|
120
|
+
[Redis](http://redis.io/)
|
121
|
+
[wikicloth gem](https://github.com/nricciar/wikicloth), by [David Ricciardi](https://github.com/nricciar/wikicloth)
|
122
|
+
[google_calendar gem](https://github.com/northworld/google_calendar), by [Northworld LLC](http://www.northworld.com/)
|
123
|
+
[geocoder gem](https://github.com/alexreisner/geocoder), by [Alex Reisner](http://www.alexreisner.com/)
|
124
|
+
[slop gem](https://github.com/injekt/slop), by [Lee Jarvis](https://github.com/injekt)
|
22
125
|
|
23
126
|
## Contributing
|
24
127
|
|
data/bin/cogibara-local
CHANGED
@@ -24,10 +24,10 @@ end
|
|
24
24
|
def parse
|
25
25
|
|
26
26
|
opts = Slop.parse do
|
27
|
-
on 'v', 'verbose', 'Verbose
|
27
|
+
on 'v', 'verbose', 'Verbose output'
|
28
28
|
on 'm=', 'message', 'Message'
|
29
29
|
on 'n=', 'name', 'Name'
|
30
|
-
on 'c=', 'config', 'Configuration file'
|
30
|
+
on 'c=', 'config', 'Configuration file (.rb)'
|
31
31
|
end
|
32
32
|
|
33
33
|
@verbose = opts.verbose?
|
data/cogibara.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["wstrinz@gmail.com"]
|
11
11
|
spec.description = %q{Modular, extensible personal assistant}
|
12
12
|
spec.summary = %q{Modular, extensible personal assistant}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/wstrinz/cogibara"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/cogibara/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cogibara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wstrinz
|
@@ -291,7 +291,7 @@ files:
|
|
291
291
|
- lib/cogibara/text_parser.rb
|
292
292
|
- lib/cogibara/transcriber.rb
|
293
293
|
- lib/cogibara/version.rb
|
294
|
-
homepage:
|
294
|
+
homepage: https://github.com/wstrinz/cogibara
|
295
295
|
licenses:
|
296
296
|
- MIT
|
297
297
|
metadata: {}
|