Class: Silas::Inbox::SessionsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/silas/inbox/sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
# File 'app/controllers/silas/inbox/sessions_controller.rb', line 4

def index
  @sessions = Silas::Session.order(created_at: :desc).limit(100)
  @sessions = @sessions.where(agent_name: params[:agent]) if params[:agent].present?
  @agent_names = Silas::Session.distinct.pluck(:agent_name).sort
  @pending_total = Silas::ToolInvocation.where(approval_state: "required").count
end

#showObject



11
12
13
14
15
# File 'app/controllers/silas/inbox/sessions_controller.rb', line 11

def show
  @session = Silas::Session.find(params[:id])
  @turns = @session.turns.includes(steps: :tool_invocations)
  @cost = Silas::Inbox::Cost.for_session(@session)
end