Skip to content

Commit

Permalink
GPTVision examples renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbanda committed Nov 27, 2023
1 parent 0ef9c8d commit 6fab023
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.cequence.openaiscala.service

import io.cequence.openaiscala.domain.response._
import io.cequence.openaiscala.domain.settings._
import io.cequence.openaiscala.domain.{BaseMessage, SystemMessage}
import io.cequence.openaiscala.domain.BaseMessage

import scala.concurrent.Future

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.cequence.openaiscala.service

import io.cequence.openaiscala.domain.{BaseMessage, FunMessage, FunctionSpec, ToolSpec}
import io.cequence.openaiscala.domain.{BaseMessage, FunctionSpec, ToolSpec}
import io.cequence.openaiscala.domain.settings._
import io.cequence.openaiscala.domain.response._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import java.util.Base64
import javax.imageio.ImageIO
import scala.concurrent.Future

object GPTVisionWithLocalFile extends Example {
object CreateChatCompletionVisionWithLocalFile extends Example {

// provide a local jpeg here
private val localImagePath = sys.env("EXAMPLE_IMAGE_PATH")
private val bufferedImage = ImageIO.read(new java.io.File(localImagePath))
private val imageBase64Source =
Base64.getEncoder.encodeToString(imageToBytes(bufferedImage, "jpeg"))

val messages = Seq(
val messages: Seq[BaseMessage] = Seq(
SystemMessage("You are a helpful assistant."),
UserSeqMessage(
Seq(
Expand All @@ -30,7 +30,7 @@ object GPTVisionWithLocalFile extends Example {
override protected def run: Future[_] =
service
.createChatCompletion(
messages = messages,
messages,
settings = CreateChatCompletionSettings(
model = ModelId.gpt_4_vision_preview,
temperature = Some(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import io.cequence.openaiscala.domain.settings.CreateChatCompletionSettings

import scala.concurrent.Future

object GPTVisionWithURL extends Example {
object CreateChatCompletionVisionWithURL extends Example {

val messages = Seq(
val messages: Seq[BaseMessage] = Seq(
SystemMessage("You are a helpful assistant."),
UserSeqMessage(
Seq(
Expand All @@ -22,7 +22,7 @@ object GPTVisionWithURL extends Example {
override protected def run: Future[_] =
service
.createChatCompletion(
messages = messages,
messages,
settings = CreateChatCompletionSettings(
model = ModelId.gpt_4_vision_preview,
temperature = Some(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.cequence.openaiscala.examples
import io.cequence.openaiscala.domain._
import io.cequence.openaiscala.domain.settings._

object CreateEditImage extends Example {
object CreateImageEdit extends Example {

private val localOtterImagePath = sys.env("EXAMPLE_OTTER_IMAGE_PATH")
override protected def run =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package io.cequence.openaiscala.examples

import akka.actor.ActorSystem
import akka.stream.Materializer
import io.cequence.openaiscala.OpenAIScalaClientException
import io.cequence.openaiscala.domain.response.ChatCompletionResponse
import io.cequence.openaiscala.service.{OpenAIService, OpenAIServiceFactory}

Expand Down

0 comments on commit 6fab023

Please sign in to comment.