braintrust 0.0.10 → 0.0.11
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 990aebc768cbd09ff44934e1c69c355d08b0c2f6f59da43de57a822ab4271aad
|
|
4
|
+
data.tar.gz: 4e99ad835dee1a5c45a9244cefca6478eab5ecb5a4f4e3c7ca929c3c94e3672f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e7646252645b7fb6e5b220a0fdfda171af86e6f12cec2eb0d31b261d764183d55aaf931100c59f2ad09ff75723f9cf3882835874148591d0ce301b464d594b4
|
|
7
|
+
data.tar.gz: 0f81b3ef9a3032d785af30612c05d38c645b56cf8227745bc8bb06e1d07a0d330c1483b2e4af628e43ef98078ea854f9baab0d76dfa9e485586bda6d38fdd549
|
data/lib/braintrust/config.rb
CHANGED
|
@@ -39,7 +39,7 @@ module Braintrust
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
new(
|
|
42
|
-
api_key: api_key || ENV["BRAINTRUST_API_KEY"],
|
|
42
|
+
api_key: api_key || ((ENV["BRAINTRUST_API_KEY"] && ENV["BRAINTRUST_API_KEY"].empty?) ? nil : ENV["BRAINTRUST_API_KEY"]),
|
|
43
43
|
org_name: org_name || ENV["BRAINTRUST_ORG_NAME"],
|
|
44
44
|
default_project: default_project || ENV["BRAINTRUST_DEFAULT_PROJECT"],
|
|
45
45
|
app_url: app_url || ENV["BRAINTRUST_APP_URL"] || "https://www.braintrust.dev",
|
|
@@ -350,10 +350,15 @@ module Braintrust
|
|
|
350
350
|
if tool_schema && tool_schema[function_key]
|
|
351
351
|
tool_params = tool_schema[function_key][:parameters] || tool_schema[function_key]["parameters"]
|
|
352
352
|
if tool_params.is_a?(Hash)
|
|
353
|
+
# Create a mutable copy if the hash is frozen
|
|
354
|
+
tool_params = tool_params.dup if tool_params.frozen?
|
|
353
355
|
tool_params.delete("strict")
|
|
354
356
|
tool_params.delete(:strict)
|
|
355
357
|
tool_params.delete("additionalProperties")
|
|
356
358
|
tool_params.delete(:additionalProperties)
|
|
359
|
+
# Assign the modified copy back
|
|
360
|
+
params_key = tool_schema[function_key].key?(:parameters) ? :parameters : "parameters"
|
|
361
|
+
tool_schema[function_key][params_key] = tool_params
|
|
357
362
|
end
|
|
358
363
|
end
|
|
359
364
|
|
data/lib/braintrust/version.rb
CHANGED