From d19b6060b034f37763d0385b4416b8f0d57e75ec Mon Sep 17 00:00:00 2001 From: Ashley Johnson <61059402+PapaRascal2020@users.noreply.github.com> Date: Mon, 2 Sep 2024 23:17:29 +0100 Subject: [PATCH] Refactor(Playground): Updated playground to be more appealing for trying it out. --- .../views/sidekick-examples/audio.blade.php | 59 +++++---- .../views/sidekick-examples/chat.blade.php | 50 ++++--- .../sidekick-examples/chatroom.blade.php | 125 ++++++++---------- .../sidekick-examples/completion.blade.php | 62 ++++++--- .../sidekick-examples/embedding.blade.php | 61 ++++++--- .../views/sidekick-examples/image.blade.php | 55 +++++--- .../views/sidekick-examples/index.blade.php | 44 +++--- .../sidekick-examples/moderate.blade.php | 62 ++++++--- .../sidekick-examples/transcribe.blade.php | 64 +++++---- .../views/sidekick-shared/layout.blade.php | 47 +++++++ 10 files changed, 384 insertions(+), 245 deletions(-) create mode 100644 resources/views/sidekick-shared/layout.blade.php diff --git a/resources/views/sidekick-examples/audio.blade.php b/resources/views/sidekick-examples/audio.blade.php index 990bc17..26cfafc 100644 --- a/resources/views/sidekick-examples/audio.blade.php +++ b/resources/views/sidekick-examples/audio.blade.php @@ -1,24 +1,37 @@ - - -
-🤖 Audio Generation Sample
+Enter text below and click convert to generate an audio file.
+ @if(isset($audio)) + + @endif +🤖 Assistant
+Hi! I am Laravel Sidekick, Just start typing below to start up a conversation with me.
+🙇 User
+{{ $message['content'] }}
+🤖 Assistant
+{{ $message['content'] }}
+{!! json_encode($response) !!}
-@endif - - +@section('title') + Completion Sample +@endsection + +@section('content') + + +🤖 Completion Sample
+Type some text into the box below and click Send to see the AIs response.
+Response
+{!! json_encode($response) !!}
+{!! json_encode($response) !!}
-@endif - - +@section('title') + Embedding Generation Sample +@endsection +@section('content') + + +🤖 Embedding Generation Sample
+Type some text into the box below and click Embed to see it's vector representation response.
+Response
+ +🤖 Image Generation Sample
+Describe the image you want in the text box below and click convert to generate an image.
+ @if(isset($image)) +-Chat | Completion | Image | Audio | Transcribe | Moderate | Embedding -
+@section('title') + Welcome to Sidekick Playground +@endsection -Note: To use this you must have configured the .env with your SIDEKICK_OPENAI_TOKEN.
- - +@section('content') + + +Note: To use this playground you must have configured the .env with your SIDEKICK_OPENAI_TOKEN.
+{!! json_encode($response) !!}
-@endif - - +@section('title') + Moderate Sample +@endsection + +@section('content') + + +🤖 Moderate Sample
+Type a dummy comment or post into the text box below and hit Send. The AI will then review the content and send back a moderation response.
+Response
+{!! json_encode($response) !!}
+{!! json_encode($response) !!}
-@endif - - +@section('title') + Transcription Generation Sample +@endsection + +@section('content') + + +🤖 Transcription Generation Sample
+Enter a URL to an audio file and click convert to generate the transcription (audio to text). + For convenience, Sidekick has added an example URL in case you don't know where to find one.
+Response
+{!! json_encode($response) !!}
+