prediction with context
This commit is contained in:
@@ -5,5 +5,6 @@ namespace App\Enums;
|
||||
enum PredictionSource: string
|
||||
{
|
||||
case Llm = 'llm';
|
||||
case LlmWithContext = 'llm_with_context';
|
||||
case Ewma = 'ewma';
|
||||
}
|
||||
|
||||
@@ -39,9 +39,14 @@ class OilPredictionResource extends Resource
|
||||
->sortable(),
|
||||
TextColumn::make('source')
|
||||
->badge()
|
||||
->formatStateUsing(fn (PredictionSource $state) => strtoupper($state->value))
|
||||
->formatStateUsing(fn (PredictionSource $state) => match ($state) {
|
||||
PredictionSource::Llm => 'LLM',
|
||||
PredictionSource::LlmWithContext => 'LLM + Context',
|
||||
PredictionSource::Ewma => 'EWMA',
|
||||
})
|
||||
->color(fn (PredictionSource $state) => match ($state) {
|
||||
PredictionSource::Llm => 'success',
|
||||
PredictionSource::LlmWithContext => 'warning',
|
||||
PredictionSource::Ewma => 'info',
|
||||
}),
|
||||
TextColumn::make('direction')
|
||||
@@ -66,6 +71,7 @@ class OilPredictionResource extends Resource
|
||||
SelectFilter::make('source')
|
||||
->options([
|
||||
PredictionSource::Llm->value => 'LLM',
|
||||
PredictionSource::LlmWithContext->value => 'LLM + Context',
|
||||
PredictionSource::Ewma->value => 'EWMA',
|
||||
]),
|
||||
SelectFilter::make('direction')
|
||||
@@ -97,9 +103,14 @@ class OilPredictionResource extends Resource
|
||||
TextEntry::make('predicted_for')->date('d M Y'),
|
||||
TextEntry::make('source')
|
||||
->badge()
|
||||
->formatStateUsing(fn (PredictionSource $state) => strtoupper($state->value))
|
||||
->formatStateUsing(fn (PredictionSource $state) => match ($state) {
|
||||
PredictionSource::Llm => 'LLM',
|
||||
PredictionSource::LlmWithContext => 'LLM + Context',
|
||||
PredictionSource::Ewma => 'EWMA',
|
||||
})
|
||||
->color(fn (PredictionSource $state) => match ($state) {
|
||||
PredictionSource::Llm => 'success',
|
||||
PredictionSource::LlmWithContext => 'warning',
|
||||
PredictionSource::Ewma => 'info',
|
||||
}),
|
||||
TextEntry::make('direction')
|
||||
|
||||
@@ -290,7 +290,7 @@ class OilPriceService
|
||||
|
||||
return new PricePrediction([
|
||||
'predicted_for' => now()->toDateString(),
|
||||
'source' => PredictionSource::Llm,
|
||||
'source' => PredictionSource::LlmWithContext,
|
||||
'direction' => $direction,
|
||||
'confidence' => $confidence,
|
||||
'reasoning' => $data['reasoning'],
|
||||
|
||||
Reference in New Issue
Block a user