heyiam 0.2.24 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/llm/index.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
1
|
import { AnthropicProvider } from './anthropic-provider.js';
|
|
2
|
-
import { ProxyProvider } from './proxy-provider.js';
|
|
3
2
|
import { getAnthropicApiKey } from '../settings.js';
|
|
4
|
-
export { ProxyError } from './proxy-provider.js';
|
|
5
3
|
/**
|
|
6
|
-
* Returns the
|
|
7
|
-
*
|
|
8
|
-
* Resolution priority:
|
|
9
|
-
* 1. If ANTHROPIC_API_KEY env var is set → AnthropicProvider (BYOK)
|
|
10
|
-
* 2. If API key saved in ~/.config/heyiam/settings.json → AnthropicProvider (BYOK)
|
|
11
|
-
* 3. Otherwise → ProxyProvider (server-side, requires auth)
|
|
4
|
+
* Returns the Anthropic LLM provider.
|
|
5
|
+
* Requires ANTHROPIC_API_KEY (env var or saved in settings).
|
|
12
6
|
*/
|
|
13
7
|
export function getProvider() {
|
|
14
|
-
|
|
15
|
-
return new AnthropicProvider();
|
|
16
|
-
}
|
|
17
|
-
return new ProxyProvider();
|
|
8
|
+
return new AnthropicProvider();
|
|
18
9
|
}
|
|
19
10
|
/**
|
|
20
|
-
* Returns
|
|
11
|
+
* Returns whether AI enhancement is available.
|
|
21
12
|
*/
|
|
22
|
-
export function
|
|
23
|
-
return getAnthropicApiKey()
|
|
13
|
+
export function hasApiKey() {
|
|
14
|
+
return !!getAnthropicApiKey();
|
|
24
15
|
}
|