Helicone Community Page

c
cvb941
Offline, last seen 2 months ago
Joined August 29, 2024
It would be great to configure the priorities and services through the Web UI instead of API calls.

It would allow to seamlessly setup new endpoints and manage the existing ones without deploying new code.
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-kotlin

Here's the code snippet:

Plain Text
 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
    }
4 comments
C
c
c
cvb941
·

Thread

14 comments
J
s
c
a