ubicloud/routes/project/inference_playground.rb
Benjamin Satzger ac61d9fe7b Playground: filter inference endpoints based on tags
In previous commits we introduced tags describing inference endpoints.
This commit adds a filter to the inference playground to consider only
endpoints with a specific tag.
2025-01-02 19:55:10 +01:00

15 lines
526 B
Ruby

# frozen_string_literal: true
class Clover
hash_branch(:project_prefix, "inference-playground") do |r|
r.on web? do
next unless @project.get_ff_inference_ui
r.get true do
@inference_endpoints = Serializers::InferenceEndpoint.serialize(inference_endpoint_ds.where(Sequel.pg_jsonb_op(:tags).get_text("capability") => "Text Generation"))
@inference_tokens = Serializers::InferenceToken.serialize(inference_token_ds.all)
view "inference/endpoint/playground"
end
end
end
end