This commit is contained in:
@@ -57,6 +57,7 @@ type MessageInput struct {
|
||||
Model statemachine.ModelSpec
|
||||
SystemPrompt string
|
||||
Messages []MessageParam
|
||||
AuthToken string // Optional JWT token for authenticated endpoints
|
||||
}
|
||||
|
||||
// MessageParam represents a message parameter.
|
||||
@@ -136,6 +137,11 @@ func (c *OpenAIClient) CreateMessage(ctx context.Context, in MessageInput) (stri
|
||||
|
||||
httpReq.Header.Set("Content-Type", "application/json")
|
||||
|
||||
// Add authentication header if token provided
|
||||
if in.AuthToken != "" {
|
||||
httpReq.Header.Set("Authorization", fmt.Sprintf("Bearer %s", in.AuthToken))
|
||||
}
|
||||
|
||||
// Send request
|
||||
resp, err := c.httpClient.Do(httpReq)
|
||||
if err != nil {
|
||||
|
||||
@@ -15,6 +15,7 @@ type LLMInferenceInput struct {
|
||||
UserPrompt string `json:"user_prompt"` // User message
|
||||
Temperature float64 `json:"temperature,omitempty"` // LLM temperature (0-1)
|
||||
MaxTokens int `json:"max_tokens,omitempty"` // Max output tokens
|
||||
AuthToken string `json:"auth_token,omitempty"` // JWT token for authenticated endpoints
|
||||
}
|
||||
|
||||
// LLMInferenceOutput is output from LLMInferenceActivity
|
||||
@@ -53,7 +54,7 @@ func LLMInferenceActivity(ctx context.Context, in LLMInferenceInput) (LLMInferen
|
||||
}
|
||||
|
||||
// Call LLM
|
||||
logger.logf("info", "Calling LLM API (model=%s, prompt_len=%d)", in.Model, len(in.UserPrompt))
|
||||
logger.logf("info", "Calling LLM API (model=%s, prompt_len=%d, auth=%v)", in.Model, len(in.UserPrompt), in.AuthToken != "")
|
||||
|
||||
response, err := client.CreateMessage(ctx, llm.MessageInput{
|
||||
Model: statemachine.ModelSpec{
|
||||
@@ -66,6 +67,7 @@ func LLMInferenceActivity(ctx context.Context, in LLMInferenceInput) (LLMInferen
|
||||
Content: in.UserPrompt,
|
||||
},
|
||||
},
|
||||
AuthToken: in.AuthToken,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
@@ -88,6 +90,7 @@ type LLMBatchInferenceInput struct {
|
||||
SystemPrompt string `json:"system_prompt"`
|
||||
Prompts []string `json:"prompts"` // List of user prompts
|
||||
Temperature float64 `json:"temperature,omitempty"`
|
||||
AuthToken string `json:"auth_token,omitempty"` // JWT token for authenticated endpoints
|
||||
}
|
||||
|
||||
// LLMBatchInferenceOutput is output from batch inference
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ metadata:
|
||||
app.kubernetes.io/name: poimen
|
||||
app.kubernetes.io/component: orchestrator
|
||||
data:
|
||||
GIT_COMMIT: "e07b9504" # Updated automatically by CI/CD
|
||||
GIT_COMMIT: "991c1f97" # Updated automatically by CI/CD
|
||||
GIT_BRANCH: "main"
|
||||
DEPLOYMENT_DATE: "2026-09-05"
|
||||
|
||||
@@ -13,7 +13,7 @@ spec:
|
||||
labels:
|
||||
app: poimen-worker
|
||||
annotations:
|
||||
git-commit: "e07b9504" # ✅ Updated on each push, triggers rolling restart
|
||||
git-commit: "991c1f97" # ✅ Updated on each push, triggers rolling restart
|
||||
deployment-date: "2026-09-05"
|
||||
spec:
|
||||
containers:
|
||||
|
||||
Reference in New Issue
Block a user