-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'EN-7354-openai-matching-clean' into staging
- Loading branch information
Showing
12 changed files
with
176 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module Admin | ||
class OpenaiRequestsController < Admin::BaseController | ||
layout 'admin_large' | ||
|
||
before_action :set_openai_request, only: [:show] | ||
|
||
def index | ||
@openai_requests = OpenaiRequest.page(page).per(per) | ||
end | ||
|
||
def show | ||
end | ||
|
||
private | ||
|
||
def set_openai_request | ||
@openai_request = OpenaiRequest.find(params[:id]) | ||
end | ||
|
||
def page | ||
params[:page] || 1 | ||
end | ||
|
||
def per | ||
params[:per] || 25 | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div class="container"> | ||
<div style="margin: auto"> | ||
<h1>openai_requests</h1> | ||
|
||
<div class="row"> | ||
<% unless @openai_requests.none? %> | ||
<table class="table custom-table"> | ||
<thead> | ||
<th>Nom</th> | ||
<th>Créé le</th> | ||
</thead> | ||
<% @openai_requests.each_with_index do |openai_request, i| %> | ||
<% parite = i.even? ? 'pair' : 'impair' %> | ||
|
||
<tr class="above-row row-<%= parite %>"> | ||
<td><%= link_to openai_request.instance.name, admin_openai_request_path(openai_request) %></td> | ||
<td><%= l openai_request.created_at %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
<% end %> | ||
</div> | ||
|
||
<%= page_entries_info @openai_requests, entry_name: 'openai_requests' %> | ||
<div class="container"> | ||
<%= paginate(@openai_requests) %> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-xs-offset-2 col-xs-8"> | ||
<ol class="breadcrumb"> | ||
<li><%= link_to "OpenAI requests", admin_openai_requests_path %></li> | ||
<li><%= @openai_request.instance.name %></li> | ||
</ol> | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<%= link_to @openai_request.instance.name, [:admin, @openai_request.instance_baseclass] %> | ||
</div> | ||
|
||
<div class="panel-body"> | ||
<p> | ||
<% if @openai_request.error? %> | ||
<span class="label label-danger">error</span> | ||
<% else %> | ||
<span class="label label-info">success</span> | ||
<% end %> | ||
</p> | ||
|
||
<p> | ||
<strong>Assistant OpenAI</strong> | ||
<%= link_to @openai_request.openai_assistant_id, @openai_request.assistant_link %> | ||
</p> | ||
|
||
<p> | ||
<strong>Thread OpenAI</strong> | ||
<%= link_to @openai_request.openai_thread_id, @openai_request.thread_link %> | ||
</p> | ||
|
||
<p> | ||
<strong>Instance type</strong> | ||
<%= @openai_request.instance_type %> | ||
</p> | ||
|
||
<p> | ||
<strong>Instance id</strong> | ||
<%= @openai_request.instance_id %> | ||
</p> | ||
|
||
<p> | ||
<strong>Lancé le:</strong> | ||
<%= l @openai_request.run_starts_at if @openai_request.run_starts_at %> | ||
</p> | ||
|
||
<p> | ||
<strong>Fini le:</strong> | ||
<%= l @openai_request.run_ends_at if @openai_request.run_ends_at %> | ||
</p> | ||
|
||
<p> | ||
<strong>Validité réponse:</strong> | ||
<%= @openai_request.response_valid? %> | ||
</p> | ||
|
||
<p> | ||
<strong>Réponse:</strong> | ||
<%= @openai_request.response %> | ||
</p> | ||
|
||
<p> | ||
<strong>Réponse formattée:</strong> | ||
<%= @openai_request.formatted_response %> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddResponseToOpenaiRequests < ActiveRecord::Migration[6.1] | ||
def change | ||
add_column :openai_requests, :response, :string | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters