spectre_ai 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/lib/spectre/openai/completions.rb +0 -21
- data/lib/spectre/version.rb +1 -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: d6cce97e6ac3ab3cde8536f7d422609ff35756847c562769f21305a68421cb89
|
4
|
+
data.tar.gz: cd092c3a8eef87550999630dc77c66eb8900ff24ed4129eff32f8050cb90a5dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4b701d7447eabb48a5c82e0d1bcbf5585c68497a49c513a81a0091e409aa84fd44d3c45e39b2b88ff53ef4643c63e047f24e88a705c3358b08be408cd0f9ed1
|
7
|
+
data.tar.gz: 639a433617ffc983cc078d26a22b516d415086c66e5091e42e1c85219f6885efe64daf924431182e1589db073a19bb8ab330c8a71793a0d5f7a95a2a2e722237
|
data/CHANGELOG.md
CHANGED
@@ -93,4 +93,13 @@ This version enhances the flexibility and robustness of the Completions class, e
|
|
93
93
|
* The `Spectre::Prompt.render` method now dynamically detects the project root based on the presence of project-specific markers, such as `Gemfile`, `.git`, or `config/application.rb`.
|
94
94
|
* This change allows for greater flexibility when using spectre in different environments and projects, ensuring the prompt templates are found regardless of where spectre is used.
|
95
95
|
* **Example**: If you're using `spectre` inside a gem, the `detect_prompts_path` method will now correctly resolve the prompts path within the gem project root.
|
96
|
-
* If no markers are found, the system falls back to the current working directory (`Dir.pwd`).
|
96
|
+
* If no markers are found, the system falls back to the current working directory (`Dir.pwd`).
|
97
|
+
|
98
|
+
# Changelog for Version 1.1.3
|
99
|
+
|
100
|
+
**Release Date:** [2nd Dec 2024]
|
101
|
+
|
102
|
+
**Fixes:**
|
103
|
+
|
104
|
+
* **Removed unnecessary validations in `Completions` class**
|
105
|
+
* Removed redundant validations in the `Completions` class that were causing unnecessary errors in specific edge cases. LLM providers returns a proper errors messages now.
|
@@ -72,27 +72,6 @@ module Spectre
|
|
72
72
|
if messages.empty?
|
73
73
|
raise ArgumentError, "Messages cannot be empty."
|
74
74
|
end
|
75
|
-
|
76
|
-
# Iterate through each message and perform detailed validation.
|
77
|
-
messages.each_with_index do |msg, index|
|
78
|
-
# Check if each message hash contains the required keys: :role and :content.
|
79
|
-
# These keys are necessary for defining the type of message and its content.
|
80
|
-
unless msg.key?(:role) && msg.key?(:content)
|
81
|
-
raise ArgumentError, "Message at index #{index} must contain both :role and :content keys."
|
82
|
-
end
|
83
|
-
|
84
|
-
# Check if the role is one of the allowed values: 'system', 'user', or 'assistant'.
|
85
|
-
# This ensures that each message has a valid role identifier.
|
86
|
-
unless %w[system user assistant].include?(msg[:role])
|
87
|
-
raise ArgumentError, "Invalid role '#{msg[:role]}' at index #{index}. Valid roles are 'system', 'user', 'assistant'."
|
88
|
-
end
|
89
|
-
|
90
|
-
# Check if the content is a non-empty string.
|
91
|
-
# This prevents empty or non-string content, which would be meaningless in a conversation.
|
92
|
-
unless msg[:content].is_a?(String) && !msg[:content].strip.empty?
|
93
|
-
raise ArgumentError, "Content for message at index #{index} must be a non-empty string."
|
94
|
-
end
|
95
|
-
end
|
96
75
|
end
|
97
76
|
|
98
77
|
# Helper method to generate the request body
|
data/lib/spectre/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spectre_ai
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Klapatok
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec-rails
|