@baseai/core
Advanced tools
Comparing version 0.9.15 to 0.9.16
@@ -1,3 +0,9 @@ | ||
# `langbase` SDK | ||
# `baseai` SDK | ||
## 0.9.16 | ||
### Patch Changes | ||
- 📦 NEW: XAI models support | ||
## 0.9.15 | ||
@@ -4,0 +10,0 @@ |
@@ -25,2 +25,3 @@ import { ChatCompletionStream } from 'openai/lib/ChatCompletionStream'; | ||
type MistralAIModels = 'mistral:mistral-large-latest' | 'mistral:open-mistral-nemo' | 'mistral:codestral-latest'; | ||
type XAIModels = 'xai:grok-beta'; | ||
type OllamaModels = `ollama:${string}`; | ||
@@ -53,3 +54,3 @@ | ||
type ToolChoice = 'auto' | 'required' | ToolChoiceFunction; | ||
type Model = OpenAIModels | TogetherModels | AnthropicModels | GroqModels | GoogleModels | CohereModels | FireworksAIModels | PerplexityModels | MistralAIModels | OllamaModels; | ||
type Model = OpenAIModels | TogetherModels | AnthropicModels | GroqModels | GoogleModels | CohereModels | FireworksAIModels | PerplexityModels | MistralAIModels | XAIModels | OllamaModels; | ||
interface Pipe$1 { | ||
@@ -56,0 +57,0 @@ apiKey?: string; |
@@ -315,2 +315,3 @@ "use strict"; | ||
var OLLAMA = "ollama"; | ||
var X_AI = "xAI"; | ||
var modelsByProvider = { | ||
@@ -691,2 +692,10 @@ [OPEN_AI]: [ | ||
} | ||
], | ||
[X_AI]: [ | ||
{ | ||
id: "grok-beta", | ||
provider: X_AI, | ||
promptCost: 5, | ||
completionCost: 15 | ||
} | ||
] | ||
@@ -716,2 +725,4 @@ }; | ||
return process.env.OLLAMA_API_KEY || ""; | ||
case modelProvider.includes(X_AI): | ||
return process.env.XAI_API_KEY || ""; | ||
default: | ||
@@ -777,3 +788,4 @@ throw new Error(`Unsupported model provider: ${modelProvider}`); | ||
perplexity: PERPLEXITY, | ||
ollama: OLLAMA | ||
ollama: OLLAMA, | ||
xai: X_AI | ||
}; | ||
@@ -780,0 +792,0 @@ const provider = providerMap[providerString.toLowerCase()]; |
{ | ||
"name": "@baseai/core", | ||
"description": "The Web AI Framework's core - BaseAI.dev", | ||
"version": "0.9.15", | ||
"version": "0.9.16", | ||
"license": "Apache-2.0", | ||
@@ -36,4 +36,4 @@ "sideEffects": false, | ||
"vitest": "1.6.0", | ||
"@baseai/eslint-config": "0.0.2", | ||
"@baseai/tsconfig": "0.0.2" | ||
"@baseai/tsconfig": "0.0.2", | ||
"@baseai/eslint-config": "0.0.2" | ||
}, | ||
@@ -40,0 +40,0 @@ "publishConfig": { |
@@ -15,2 +15,3 @@ import { ChatCompletionStream } from 'openai/lib/ChatCompletionStream'; | ||
type MistralAIModels = 'mistral:mistral-large-latest' | 'mistral:open-mistral-nemo' | 'mistral:codestral-latest'; | ||
type XAIModels = 'xai:grok-beta'; | ||
type OllamaModels = `ollama:${string}`; | ||
@@ -43,3 +44,3 @@ | ||
type ToolChoice = 'auto' | 'required' | ToolChoiceFunction; | ||
type Model = OpenAIModels | TogetherModels | AnthropicModels | GroqModels | GoogleModels | CohereModels | FireworksAIModels | PerplexityModels | MistralAIModels | OllamaModels; | ||
type Model = OpenAIModels | TogetherModels | AnthropicModels | GroqModels | GoogleModels | CohereModels | FireworksAIModels | PerplexityModels | MistralAIModels | XAIModels | OllamaModels; | ||
interface Pipe$1 { | ||
@@ -46,0 +47,0 @@ apiKey?: string; |
@@ -299,2 +299,3 @@ "use strict"; | ||
var OLLAMA = "ollama"; | ||
var X_AI = "xAI"; | ||
var modelsByProvider = { | ||
@@ -675,2 +676,10 @@ [OPEN_AI]: [ | ||
} | ||
], | ||
[X_AI]: [ | ||
{ | ||
id: "grok-beta", | ||
provider: X_AI, | ||
promptCost: 5, | ||
completionCost: 15 | ||
} | ||
] | ||
@@ -700,2 +709,4 @@ }; | ||
return process.env.OLLAMA_API_KEY || ""; | ||
case modelProvider.includes(X_AI): | ||
return process.env.XAI_API_KEY || ""; | ||
default: | ||
@@ -761,3 +772,4 @@ throw new Error(`Unsupported model provider: ${modelProvider}`); | ||
perplexity: PERPLEXITY, | ||
ollama: OLLAMA | ||
ollama: OLLAMA, | ||
xai: X_AI | ||
}; | ||
@@ -764,0 +776,0 @@ const provider = providerMap[providerString.toLowerCase()]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
421486
5122
46