Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix welcome message encoding issue #27

Merged
merged 2 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ paths:
schema:
type: string
description: 목표 ID
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoalUpdateRequest'
examples:
GoalUpdateRequestExample:
value:
title: 중앙해커톤 대상
startDate: 2024-08-06
endDate: 2024-08-07
thumbnail: https://3-namsong-st.s3.ap-northeast-2.amazonaws.com/goals/b46f73d9-fa83-4331-b37d-996897280aa6.jpeg...
status: CLOSED
responses:
"200":
description: OK
Expand Down Expand Up @@ -398,6 +412,28 @@ components:
thumbnail:
type: string
description: 목표 썸네일 이미지
GoalUpdateRequest:
type: object
properties:
title:
type: string
description: 목표 이름
startDate:
type: string
description: 목표 시작일
endDate:
type: string
description: 목표 종료일
thumbnail:
type: string
description: 썸네일 이미지 URL
status:
type: string
enum:
- OPEN
- CLOSED
- OVERDUE
description: 목표 상태
GoalResponse:
type: object
properties:
Expand Down
7 changes: 6 additions & 1 deletion src/main/kotlin/com/likelionhgu/stepper/chat/ChatService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ class ChatService(
val res = assistantService.listAssistants().resolve()
?: throw FailedAssistantException("Failed to fetch assistants")

return res.data.find { it.name == assistantName }?.id
return res.data
.find { it.name == assistantName }
?.let { assistant ->
redisTemplate.opsForValue().set(ASSISTANT_REDIS_KEY_PREFIX + assistant.name, assistant.id)
assistant.id
}
}

private fun createAssistant(assistantName: String): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import com.likelionhgu.stepper.openai.ModelType


class AssistantProperties(
val welcomeMessages: List<String>,
val instructions: String,
welcomeMessages: List<String>,
model: String
) {
val modelType: ModelType = ModelType.of(model)
val welcomeMessages: List<String> = welcomeMessages.map {
String(it.toByteArray(Charsets.ISO_8859_1))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ class WebSocketConfig(
companion object {
private const val DEFAULT_APP_DESTINATION = "/app"
private const val DEFAULT_BROKER_DESTINATION = "/queue"
private const val ENDPOINT = "/stepper"
private const val ENDPOINT = "/chatbot"
}
}
Loading