chore: add letta source header (#139)

This commit is contained in:
cthomas
2025-12-01 16:18:30 -08:00
committed by GitHub
parent 50c0564460
commit edd173cf34
3 changed files with 14 additions and 3 deletions

View File

@@ -59,5 +59,9 @@ export async function getClient() {
settingsManager.updateSettings({ env: updatedEnv });
}
return new Letta({ apiKey, baseURL });
return new Letta({
apiKey,
baseURL,
defaultHeaders: { "X-Letta-Source": "letta-code" },
});
}

View File

@@ -201,7 +201,11 @@ export async function validateCredentials(
): Promise<boolean> {
try {
// Create a temporary client to test authentication
const client = new Letta({ apiKey, baseURL: baseUrl });
const client = new Letta({
apiKey,
baseURL: baseUrl,
defaultHeaders: { "X-Letta-Source": "letta-code" },
});
// Try to list agents - this requires valid authentication
await client.agents.list({ limit: 1 });

View File

@@ -23,7 +23,10 @@ describeOrSkip("Link/Unlink Tools", () => {
throw new Error("LETTA_API_KEY required for tests");
}
client = new Letta({ apiKey });
client = new Letta({
apiKey,
defaultHeaders: { "X-Letta-Source": "letta-code" },
});
const agent = await client.agents.create({
model: "openai/gpt-4o-mini",