Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
## [0.2.6] - 2025-03-07

- Fixed span for local adapter.

## [0.2.7] - 2025-03-07

- Fixed generation update and model field in traces.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
llm_eval_ruby (0.2.6)
llm_eval_ruby (0.2.7)
httparty (~> 0.22.0)
liquid (~> 5.5.0)

Expand Down
17 changes: 11 additions & 6 deletions lib/llm_eval_ruby/api_clients/langfuse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ def fetch_prompt(name:, version:)
response["prompt"]
end

# We are using the same method for updating trace
# Langfuse does an upsert if id is given
def create_trace(params = {})
body = {
id: params[:id],
name: params[:name],
input: params[:input],
sessionId: params[:session_id],
userId: params[:user_id],
metadata: params[:metadata] || {}
id: params[:id]
}
body[:name] = params[:name] if params[:name]
body[:input] = params[:input] if params[:input]
body[:sessionId] = params[:session_id] if params[:session_id]
body[:userId] = params[:user_id] if params[:user_id]
body[:metadata] = params[:metadata] if params[:metadata]
body[:output] = params[:output] if params[:output]

create_event(type: "trace-create", body:)
end

Expand Down Expand Up @@ -67,6 +71,7 @@ def create_generation(params = {})
release: params[:release] || "UNKNOWN",
version: params[:version] || "UNKNOWN",
metadata: params[:metadata] || {},
model: params[:model] || "UNKNOWN",
promptName: params[:prompt_name],
promptVersion: params[:prompt_version]
}
Expand Down
1 change: 1 addition & 0 deletions lib/llm_eval_ruby/trace_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module TraceTypes
:prompt_version,
:usage,
:metadata,
:model,
keyword_init: true) do
def end(output:, usage: nil)
self.output = output
Expand Down
2 changes: 1 addition & 1 deletion lib/llm_eval_ruby/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module LlmEvalRuby
VERSION = "0.2.6"
VERSION = "0.2.7"
end
2 changes: 1 addition & 1 deletion spec/llm_eval_ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

RSpec.describe LlmEvalRuby do
it "has a version number" do
expect(LlmEvalRuby::VERSION).to be("0.2.6")
expect(LlmEvalRuby::VERSION).to be("0.2.7")
end
end
Loading