I'm using the Proxy configuration to send OpenAI requests to Helicone using HTTP. The prompt responses are returned successfully, but the requests are not logged anywhere in the web console.
The requests are for the
gpt-4-vision-preview
model and contain an image.
I'm using this Kotlin library to send the requests:
https://github.com/aallam/openai-kotlinHere's the code snippet:
private val openAI = OpenAI(
token = "xxx",
host = OpenAIHost(baseUrl = "https://oai.hconeai.com/v1/"),
headers = mapOf("Helicone-Auth" to "xxx")
)
override suspend fun prompt(image: ByteArray, text: String, userId: String?): String {
val encoded = image.encodeBase64()
val request = chatCompletionRequest {
model = ModelId("gpt-4-vision-preview")
messages {
system {
content = text
}
user {
content {
image("data:image/jpeg;base64,$encoded", detail = "Screenshot")
}
}
}
maxTokens = 500
userId?.let { [email protected] = it }
}
val response = openAI.chatCompletion(request)
val content = response.choices.first().message.content.orEmpty()
return content
}