feat: add JWT auth token support to LLM inference activities
ci / test (push) Failing after 2m14s

This commit is contained in:
Test
2026-09-05 00:47:22 -07:00
parent 0da90fdd7a
commit 00fc83c081
4 changed files with 12 additions and 3 deletions
+4 -1
View File
@@ -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