Skip to content

Commit

Permalink
fix: lambda auth header chars (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
silimarius authored Feb 12, 2024
1 parent e03dca9 commit 1318a77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/service/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ export class Agent {
parameters: { max_new_tokens: 58, top_p: 1, temperature: 0.8 }, // TODO define final parameters as constants
});

const authorizationToken = env.LAMBDA_TOKEN.replace(/\r?\n|\r/g, "");

try {
const response = await fetch(env.AWS_INFERENCE_URL, {
headers: {
"Content-Type": "application/json",
authorizationToken: env.LAMBDA_TOKEN,
"content-type": "application/json",
authorizationToken,
},
method: "POST",
body,
Expand Down

0 comments on commit 1318a77

Please sign in to comment.