chore: add letta source header (#139)
This commit is contained in:
@@ -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" },
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user