Files
maybe/app/javascript/controllers/example_question_controller.js
Josh Pigford 9c87deb508 Enhance AI Financial Assistant with Advanced Querying and Debugging Capabilities
- Implement comprehensive AI financial query system with function-based interactions
- Add detailed debug logging for AI responses and function calls
- Extend BalanceSheet and IncomeStatement models with AI-friendly methods
- Create robust error handling and fallback mechanisms for AI queries
- Update chat and message views to support debug mode and enhanced rendering
- Add AI query routes and initial test coverage for financial assistant
2025-02-28 12:52:10 -05:00

21 lines
580 B
JavaScript

import { Controller } from "@hotwired/stimulus"
// Connects to data-controller="example-question"
export default class extends Controller {
static values = { text: String }
fillForm(event) {
event.preventDefault()
// Find the textarea in the form
const textarea = document.querySelector("textarea[name='message[content]']")
if (!textarea) return
// Set the value and focus
textarea.value = this.textValue
textarea.focus()
// Trigger input event to resize the textarea if using autogrow
textarea.dispatchEvent(new Event('input'))
}
}