@callstack/byorg-core
Advanced tools
Comparing version 0.7.0 to 0.8.0
# @callstack/byorg-core | ||
## 0.8.0 | ||
### Minor Changes | ||
- 21d4f2e: core: expose `ChatModel.name` property | ||
### Patch Changes | ||
- cb21f9a: Fixed missing references | ||
- Updated dependencies [ea21cc7] | ||
- @callstack/byorg-utils@0.8.0 | ||
## 0.7.0 | ||
@@ -4,0 +16,0 @@ |
@@ -43,2 +43,3 @@ import { LanguageModel } from 'ai'; | ||
export declare interface ChatModel { | ||
name: string; | ||
generateResponse(context: RequestContext): Promise<AssistantResponse>; | ||
@@ -219,4 +220,5 @@ } | ||
export declare class VercelChatModelAdapter implements ChatModel { | ||
private readonly _options; | ||
constructor(_options: VercelChatModelAdapterOptions); | ||
config: VercelChatModelAdapterConfig; | ||
constructor(config: VercelChatModelAdapterConfig); | ||
get name(): string; | ||
generateResponse(context: RequestContext): Promise<AssistantResponse>; | ||
@@ -228,3 +230,3 @@ private executeRequestWithStreaming; | ||
export declare type VercelChatModelAdapterOptions = { | ||
export declare type VercelChatModelAdapterConfig = { | ||
languageModel: LanguageModel; | ||
@@ -231,0 +233,0 @@ maxTokens?: number; |
@@ -116,4 +116,4 @@ import * as __WEBPACK_EXTERNAL_MODULE__callstack_byorg_utils__ from "@callstack/byorg-utils"; | ||
return { | ||
addReferences (references) { | ||
for (const ref of references){ | ||
addReferences (referencesToAdd) { | ||
for (const ref of referencesToAdd){ | ||
const refKey = getKey(ref); | ||
@@ -298,6 +298,9 @@ if (!referencesKeys.has(refKey)) { | ||
class VercelChatModelAdapter { | ||
_options; | ||
constructor(_options){ | ||
this._options = _options; | ||
config; | ||
constructor(config){ | ||
this.config = config; | ||
} | ||
get name() { | ||
return this.config.languageModel.modelId; | ||
} | ||
async generateResponse(context) { | ||
@@ -352,6 +355,6 @@ let systemPrompt = context.systemPrompt(); | ||
...VERCEL_AI_SHARED_OPTIONS, | ||
model: this._options.languageModel, | ||
model: this.config.languageModel, | ||
maxTokens: this.config.maxTokens, | ||
maxSteps: this.config.maxSteps, | ||
messages: context.messages, | ||
maxTokens: this._options.maxTokens, | ||
maxSteps: this._options.maxSteps, | ||
tools: context.tools | ||
@@ -382,6 +385,6 @@ }); | ||
...VERCEL_AI_SHARED_OPTIONS, | ||
model: this._options.languageModel, | ||
model: this.config.languageModel, | ||
maxTokens: this.config.maxTokens, | ||
maxSteps: this.config.maxSteps, | ||
messages: context.messages, | ||
maxTokens: this._options.maxTokens, | ||
maxSteps: this._options.maxSteps, | ||
tools: context.tools | ||
@@ -550,2 +553,3 @@ }); | ||
calls, | ||
name: 'mock', | ||
generateResponse: async (context)=>{ | ||
@@ -552,0 +556,0 @@ calls.push([ |
{ | ||
"name": "@callstack/byorg-core", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"type": "module", | ||
@@ -28,3 +28,3 @@ "license": "MIT", | ||
"zod": "^3.23.8", | ||
"@callstack/byorg-utils": "0.7.0" | ||
"@callstack/byorg-utils": "0.8.0" | ||
}, | ||
@@ -31,0 +31,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60585
1376
+ Added@callstack/byorg-utils@0.8.0(transitive)
- Removed@callstack/byorg-utils@0.7.0(transitive)
Updated@callstack/byorg-utils@0.8.0