Skip to content

Commit 92b2253

Browse files
committed
ack'd PR comments
1 parent 209d2e0 commit 92b2253

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

apps/sim/blocks/blocks/agent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ Example 3 (Array Input):
715715
},
716716
model: { type: 'string', description: 'AI model to use' },
717717
apiKey: { type: 'string', description: 'Provider API key' },
718-
azureEndpoint: { type: 'string', description: 'Azure OpenAI endpoint URL' },
718+
azureEndpoint: { type: 'string', description: 'Azure endpoint URL' },
719719
azureApiVersion: { type: 'string', description: 'Azure API version' },
720720
vertexProject: { type: 'string', description: 'Google Cloud project ID for Vertex AI' },
721721
vertexLocation: { type: 'string', description: 'Google Cloud location for Vertex AI' },

apps/sim/lib/guardrails/validate_hallucination.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ Evaluate the consistency and provide your score and reasoning in JSON format.`
143143
const providerId = getProviderFromModel(model)
144144

145145
// Resolve Vertex AI OAuth credential to access token if needed
146-
let resolvedApiKey = apiKey
147-
const resolvedCredentials = { ...providerCredentials }
146+
let finalApiKey = apiKey
148147
if (providerId === 'vertex' && providerCredentials?.vertexCredential) {
149148
const credential = await db.query.account.findFirst({
150149
where: eq(account.id, providerCredentials.vertexCredential),
@@ -156,10 +155,9 @@ Evaluate the consistency and provide your score and reasoning in JSON format.`
156155
providerCredentials.vertexCredential
157156
)
158157
if (accessToken) {
159-
resolvedApiKey = accessToken
158+
finalApiKey = accessToken
160159
}
161160
}
162-
resolvedCredentials.vertexCredential = undefined
163161
}
164162

165163
const response = await executeProviderRequest(providerId, {
@@ -172,8 +170,14 @@ Evaluate the consistency and provide your score and reasoning in JSON format.`
172170
},
173171
],
174172
temperature: 0.1, // Low temperature for consistent scoring
175-
apiKey: resolvedApiKey,
176-
...resolvedCredentials,
173+
apiKey: finalApiKey,
174+
azureEndpoint: providerCredentials?.azureEndpoint,
175+
azureApiVersion: providerCredentials?.azureApiVersion,
176+
vertexProject: providerCredentials?.vertexProject,
177+
vertexLocation: providerCredentials?.vertexLocation,
178+
bedrockAccessKeyId: providerCredentials?.bedrockAccessKeyId,
179+
bedrockSecretKey: providerCredentials?.bedrockSecretKey,
180+
bedrockRegion: providerCredentials?.bedrockRegion,
177181
})
178182

179183
if (response instanceof ReadableStream || ('stream' in response && 'execution' in response)) {

0 commit comments

Comments
 (0)