feat: add JWT auth token support to LLM inference activities
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 {
|
||||
|
||||
Reference in New Issue
Block a user