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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03f80dea5773af148c7f339f9d3e7dec8a88f2af6221a4faf7fcf37c98cff736
4
- data.tar.gz: 2b3c9838f177e073bb2c32ec12d16e2de4338939a095cf242bc67f5935bed6e8
3
+ metadata.gz: 64fd3f60b8990199612b32866ce07933935d3e11b2d02ec1d9af945d0e772e1a
4
+ data.tar.gz: 7bbedc657b1b1d6d8678a1d68f1258bf5a199f4649bba11984eecd1bcf47f10d
5
5
  SHA512:
6
- metadata.gz: d5f20ee178bec92ff8015297ca8c4a9f8d8480d4bf164f279acc7b005f477fe9a1d2448990939bfd774aeaebd9744a470129cb9c07feb4109e15cd4a27751fcc
7
- data.tar.gz: f063f51a9902fae91bebd5f4436631aa837af8c92efb57673c81a43737d4821ad399b9fc809b8c41ca32d481714418231b2ebfd5936b8793003557b6399d0f11
6
+ metadata.gz: ee56e04615f8fb0d70b475e8198c708eaf3f4903d16ed29a8d7a85da6a8d28ce61ed7a4f6e63a45192f893e2a6e5cf29503a9e9c2f66afeffe37a32390c1ef7f
7
+ data.tar.gz: d2ed841e95c5e010d4649db34a83e3ed977c3f975053211b9cb010a33f46c4f3b8c3965245de09c7461304c9035ca5a91fddc33b414b6eda0ae930f05d30cfd6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.3] - 2025-03-04
2
+
3
+ - Add an instructions input that translates to a system prompt
4
+
1
5
  ## [0.0.2] - 2025-03-03
2
6
 
3
7
  - Release as a gem
@@ -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: "You are a scientific-minded assistant who answers concisely and precisely.",
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
@@ -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: "You are a scientific-minded assistant who answers concisely and precisely."
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
@@ -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: "You are a scientific-minded assistant who answers concisely and precisely."
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.2
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-04 00:00:00.000000000 Z
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