feat: add JWT auth token support to LLM inference activities

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