foobara-ai 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/src/foobara/ai/answer_bot/ask.rb +1 -0
- data/src/foobara/ai/answer_bot/domain_mappers/anthropic_api/question_to_create_message.rb +7 -1
- data/src/foobara/ai/answer_bot/domain_mappers/ollama_api/question_to_generate_chat_completion.rb +8 -1
- data/src/foobara/ai/answer_bot/domain_mappers/open_ai_api/question_to_create_chat_completion.rb +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64fd3f60b8990199612b32866ce07933935d3e11b2d02ec1d9af945d0e772e1a
|
4
|
+
data.tar.gz: 7bbedc657b1b1d6d8678a1d68f1258bf5a199f4649bba11984eecd1bcf47f10d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee56e04615f8fb0d70b475e8198c708eaf3f4903d16ed29a8d7a85da6a8d28ce61ed7a4f6e63a45192f893e2a6e5cf29503a9e9c2f66afeffe37a32390c1ef7f
|
7
|
+
data.tar.gz: d2ed841e95c5e010d4649db34a83e3ed977c3f975053211b9cb010a33f46c4f3b8c3965245de09c7461304c9035ca5a91fddc33b414b6eda0ae930f05d30cfd6
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,7 @@ module Foobara
|
|
6
6
|
|
7
7
|
inputs do
|
8
8
|
question :string, :required, "whatever you want to know!"
|
9
|
+
instructions :string, "Results in a system prompt. You can specify how you want the LLM to behave."
|
9
10
|
service :service_enum, "If two services expose the same model, you can specify which one to use."
|
10
11
|
model :model_enum, default: "gpt-3.5-turbo", description: "The model to use."
|
11
12
|
end
|
@@ -8,13 +8,15 @@ module Foobara
|
|
8
8
|
class QuestionToCreateMessage < Foobara::DomainMapper
|
9
9
|
from do
|
10
10
|
question :string, :required
|
11
|
+
instructions :string,
|
12
|
+
default: "You are a scientific-minded assistant who answers concisely and precisely."
|
11
13
|
model :model_enum
|
12
14
|
end
|
13
15
|
to Foobara::Ai::AnthropicApi::CreateMessage
|
14
16
|
|
15
17
|
def map
|
16
18
|
{
|
17
|
-
system:
|
19
|
+
system: instructions,
|
18
20
|
messages: [
|
19
21
|
{
|
20
22
|
role: "user",
|
@@ -35,6 +37,10 @@ module Foobara
|
|
35
37
|
def model
|
36
38
|
from[:model]
|
37
39
|
end
|
40
|
+
|
41
|
+
def instructions
|
42
|
+
from[:instructions]
|
43
|
+
end
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
data/src/foobara/ai/answer_bot/domain_mappers/ollama_api/question_to_generate_chat_completion.rb
CHANGED
@@ -8,6 +8,9 @@ module Foobara
|
|
8
8
|
class QuestionToGenerateChatCompletion < Foobara::DomainMapper
|
9
9
|
from do
|
10
10
|
question :string, :required
|
11
|
+
instructions :string,
|
12
|
+
default: "You are a scientific-minded assistant who answers concisely and precisely."
|
13
|
+
|
11
14
|
model :model_enum
|
12
15
|
end
|
13
16
|
to Foobara::Ai::OllamaApi::GenerateChatCompletion
|
@@ -17,7 +20,7 @@ module Foobara
|
|
17
20
|
messages: [
|
18
21
|
{
|
19
22
|
role: "system",
|
20
|
-
content:
|
23
|
+
content: instructions
|
21
24
|
},
|
22
25
|
{
|
23
26
|
role: "user",
|
@@ -38,6 +41,10 @@ module Foobara
|
|
38
41
|
def model
|
39
42
|
from[:model]
|
40
43
|
end
|
44
|
+
|
45
|
+
def instructions
|
46
|
+
from[:instructions]
|
47
|
+
end
|
41
48
|
end
|
42
49
|
end
|
43
50
|
end
|
data/src/foobara/ai/answer_bot/domain_mappers/open_ai_api/question_to_create_chat_completion.rb
CHANGED
@@ -8,6 +8,8 @@ module Foobara
|
|
8
8
|
class QuestionToCreateChatCompletion < Foobara::DomainMapper
|
9
9
|
from do
|
10
10
|
question :string, :required
|
11
|
+
instructions :string,
|
12
|
+
default: "You are a scientific-minded assistant who answers concisely and precisely."
|
11
13
|
model :model_enum
|
12
14
|
end
|
13
15
|
to Foobara::Ai::OpenAiApi::CreateChatCompletion
|
@@ -17,7 +19,7 @@ module Foobara
|
|
17
19
|
messages: [
|
18
20
|
{
|
19
21
|
role: "system",
|
20
|
-
content:
|
22
|
+
content: instructions
|
21
23
|
},
|
22
24
|
{
|
23
25
|
role: "user",
|
@@ -38,6 +40,10 @@ module Foobara
|
|
38
40
|
def model
|
39
41
|
from[:model]
|
40
42
|
end
|
43
|
+
|
44
|
+
def instructions
|
45
|
+
from[:instructions]
|
46
|
+
end
|
41
47
|
end
|
42
48
|
end
|
43
49
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
10
|
+
date: 2025-03-05 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: foobara-anthropic-api
|