chore(damn): detekt, build, tests, formatting
fixed detekt issues where possible. fixed disttar failing build because tools is added twice in the server module. added workflowId where required. fixed some tests not being recognized because of runBlocking without explicit return type. formatting + imports.
This commit is contained in:
@@ -44,4 +44,4 @@ class DefaultInferenceReducer : InferenceReducer {
|
||||
return state.copy(records = updated)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ sealed class FinishReason {
|
||||
object Cancelled : FinishReason()
|
||||
@Serializable
|
||||
data class Error(val message: String) : FinishReason()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ data class GenerationConfig(
|
||||
val maxTokens: Int,
|
||||
val stopSequences: List<String> = emptyList(),
|
||||
val seed: Long? = null, // null = non-deterministic; set for replay
|
||||
)
|
||||
)
|
||||
|
||||
+1
-1
@@ -28,4 +28,4 @@ package com.correx.core.inference
|
||||
interface InferenceCancellationToken {
|
||||
val isCancelled: Boolean
|
||||
fun cancel(reason: CancellationReason)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,4 @@ class InferenceProjector(
|
||||
state: InferenceState,
|
||||
event: StoredEvent
|
||||
): InferenceState = reducer.reduce(state, event)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ interface ProviderRegistry {
|
||||
fun resolve(capability: ModelCapability): List<InferenceProvider> // ordered by score desc
|
||||
fun listAll(): List<InferenceProvider>
|
||||
suspend fun healthCheckAll(): Map<ProviderId, ProviderHealth>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ data class InferenceRecord(
|
||||
val tokensUsed: TokenUsage? = null,
|
||||
val latencyMs: Long? = null,
|
||||
val failureReason: String? = null,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -4,4 +4,4 @@ import com.correx.core.events.events.StoredEvent
|
||||
|
||||
interface InferenceReducer {
|
||||
fun reduce(state: InferenceState, event: StoredEvent): InferenceState
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,4 +9,4 @@ class InferenceRepository(
|
||||
fun getInferenceState(sessionId: SessionId): InferenceState {
|
||||
return replayer.rebuild(sessionId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,4 +16,4 @@ data class InferenceRequest(
|
||||
val timeout: InferenceTimeout? = null,
|
||||
val responseFormat: ResponseFormat = ResponseFormat.Text,
|
||||
val tools: List<ToolDefinition> = emptyList(),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -11,4 +11,4 @@ data class InferenceResponse(
|
||||
val tokensUsed: TokenUsage,
|
||||
val latencyMs: Long,
|
||||
val toolCalls: List<ToolCallRequest> = emptyList(),
|
||||
)
|
||||
)
|
||||
|
||||
@@ -41,4 +41,4 @@ class ProviderUnavailableException(
|
||||
reason: String,
|
||||
) : Exception(
|
||||
"Provider '${providerId.value}' is unavailable: $reason",
|
||||
)
|
||||
)
|
||||
|
||||
@@ -5,4 +5,4 @@ import kotlinx.serialization.Serializable
|
||||
@Serializable
|
||||
data class InferenceState(
|
||||
val records: List<InferenceRecord> = emptyList()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -2,4 +2,4 @@ package com.correx.core.inference
|
||||
|
||||
enum class InferenceStatus {
|
||||
STARTED, COMPLETED, FAILED, TIMED_OUT
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ sealed class ProviderHealth {
|
||||
object Healthy : ProviderHealth()
|
||||
data class Degraded(val reason: String) : ProviderHealth()
|
||||
data class Unavailable(val reason: String) : ProviderHealth()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,4 @@ value class Token(val id: Int)
|
||||
interface Tokenizer {
|
||||
suspend fun tokenize(text: String): List<Token>
|
||||
suspend fun countTokens(text: String): Int
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,4 @@ data class ToolCallRequest(
|
||||
data class ToolCallFunction(
|
||||
val name: String,
|
||||
val arguments: String,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user