import info.mechyrdia.MainDomainName
import info.mechyrdia.data.*
import java.time.Instant
+import java.time.ZoneId
import java.time.format.DateTimeFormatter
private val AVERAGE_FACTBOOK_INTRO_CHANGEFREQ = SitemapChangeFrequency.DAILY
get() = name.lowercase()
val Instant.xmlValue: String
- get() = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this)
+ get() = DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(atZone(ZoneId.of("Z")))
val Double.xmlValue: String
get() = "%f".format(this)
"https://api.openai.com/v1/files/${fileId.id}"
).body<RobotFileDeletionResponse>()
- suspend fun downloadFile(fileId: RobotFileId) = client.delete(
- "https://api.openai.com/v1/files/${fileId.id}"
+ suspend fun downloadFile(fileId: RobotFileId) = client.get(
+ "https://api.openai.com/v1/files/${fileId.id}/content"
).body<ByteArray>()
suspend fun createVectorStore(request: RobotCreateVectorStoreRequest) = client.post("https://api.openai.com/v1/vector_stores") {
setJsonBody(request)
}.body<RobotVectorStore>()
- suspend fun addFileToVectorStore(vsId: RobotVectorStoreId, fileId: RobotFileId) = client.post("https://api.openai.com/v1/vector_stores/${vsId.id}") {
+ suspend fun addFileToVectorStore(vsId: RobotVectorStoreId, fileId: RobotFileId) = client.post("https://api.openai.com/v1/vector_stores/${vsId.id}/files") {
setJsonBody(RobotAddFileToVectorStoreRequest(fileId))
}.body<RobotVectorStoreFile>()
robotGlobals = robotGlobals.copy(
assistantId = robotClient.createAssistant(
RobotCreateAssistantRequest(
- model = "gpt-4-turbo",
+ model = "gpt-4o",
name = "Natural-language Universal Knowledge Engine",
instructions = "You are a helpful interactive encyclopedia, able to answer questions with information from the provided files",
tools = listOf(