@hypermode/models-as
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -19,3 +19,3 @@ import { JSON } from "json-as"; | ||
public readonly info: ModelInfo, | ||
private invoker: ModelInvoker, | ||
protected invoker: ModelInvoker, | ||
) {} | ||
@@ -46,4 +46,4 @@ | ||
return JSON.parse<TOutput>(outputJson, true); | ||
return JSON.parse<TOutput>(outputJson); | ||
} | ||
} |
@@ -33,2 +33,3 @@ import { Model } from "../.."; | ||
*/ | ||
@omitif("this.temperature == 0.6") | ||
temperature: f64 = 0.6; | ||
@@ -42,2 +43,3 @@ | ||
*/ | ||
@omitif("this.topP == 0.9") | ||
@alias("top_p") | ||
@@ -51,2 +53,3 @@ topP: f64 = 0.9; | ||
*/ | ||
@omitif("this.maxGenLen == 512") | ||
@alias("max_gen_len") | ||
@@ -53,0 +56,0 @@ maxGenLen: i32 = 512; |
@@ -23,2 +23,3 @@ import { Model } from "../.."; | ||
@alias("frequency_penalty") | ||
@omitif("this.frequencyPenalty == 0.0") | ||
frequencyPenalty: f64 = 0.0; | ||
@@ -28,12 +29,21 @@ | ||
@alias("logit_bias") | ||
@omitnull() | ||
logitBias: Map<string, f64> | null = null; | ||
@omitif("this.logprobs == false") | ||
logprobs: bool = false; | ||
// @alias("top_logprobs") | ||
// topLogprobs: i32 = 0; // TODO: only send when logprobs is true | ||
@alias("top_logprobs") | ||
@omitif("this.logprobs == false") | ||
topLogprobs: i32 = 0; | ||
@alias("max_tokens") | ||
maxTokens: i32 = 4096; | ||
@omitif("this.maxTokens == 4096") | ||
maxTokens: i32 = 4096; // TODO: make this an `i32 | null` when supported | ||
@omitif("this.n == 1") | ||
n: i32 = 1; | ||
@@ -43,2 +53,3 @@ | ||
@alias("presence_penalty") | ||
@omitif("this.presencePenalty == 0.0") | ||
presencePenalty: f64 = 0.0; | ||
@@ -48,11 +59,20 @@ | ||
@alias("response_format") | ||
@omitif("this.responseFormat.type == 'text'") | ||
responseFormat: ResponseFormat = ResponseFormat.Text; | ||
// seed: i32 | null = null; // TODO: we need a true Nullable<i32> type for this to work | ||
@omitif("this.seed == -1") | ||
seed: i32 = -1; // TODO: make this an `i32 | null` when supported | ||
@omitnull() | ||
stop: string[] | null = null; | ||
// stream: bool = false; | ||
// @omitif("this.stream == false") | ||
// @alias("stream_options") | ||
// streamOptions: StreamOptions | null = null; | ||
@omitif("this.temperature == 1.0") | ||
temperature: f64 = 1.0; | ||
@@ -62,4 +82,7 @@ | ||
@alias("top_p") | ||
@omitif("this.topP == 1.0") | ||
topP: f64 = 1.0; | ||
@omitnull() | ||
tools: Tool[] | null = null; | ||
@@ -69,8 +92,12 @@ | ||
@alias("tool_choice") | ||
@omitnull() | ||
toolChoice: string | null = null; // TODO: verify this works | ||
// @alias("parallel_tool_calls") | ||
// parallelToolCalls: bool = true; // TODO: omit this when no tools | ||
@alias("user") | ||
@alias("parallel_tool_calls") | ||
@omitif("this.parallelToolCalls == true || !this.tools || this.tools!.length == 0") | ||
parallelToolCalls: bool = true; | ||
@omitnull() | ||
user: string | null = null; | ||
@@ -107,2 +134,3 @@ } | ||
// @omitif("this.includeUsage == false") | ||
// @alias("include_usage") | ||
@@ -121,4 +149,10 @@ // includeUsage: bool = false; | ||
export class FunctionDefinition { | ||
name!: string; | ||
@omitnull() | ||
description: string | null = null; | ||
name!: string; | ||
@omitnull() | ||
parameters: string | null = null; // TODO: verify this works | ||
@@ -223,2 +257,4 @@ } | ||
@omitnull() | ||
name: string | null = null; | ||
@@ -234,2 +270,4 @@ } | ||
@omitnull() | ||
name: string | null = null; | ||
@@ -245,2 +283,4 @@ } | ||
@omitnull() | ||
name: string | null = null; | ||
@@ -250,2 +290,3 @@ | ||
@alias("tool_calls") | ||
@omitif("this.toolCalls.length == 0") | ||
toolCalls: ToolCall[] = []; | ||
@@ -252,0 +293,0 @@ } |
@@ -1,2 +0,1 @@ | ||
// import { Box } from "as-container/assembly"; | ||
import { Model } from "../.."; | ||
@@ -21,5 +20,14 @@ | ||
model!: string; | ||
@omitif("this.encodingFormat.type == 'float'") | ||
encodingFormat: EncodingFormat = EncodingFormat.Float; | ||
// dimensions: Box<i32> | null = null; | ||
user: string = ""; | ||
@omitif("this.dimensions == -1") | ||
dimensions: i32 = -1; // TODO: make this an `i32 | null` when supported | ||
@omitnull() | ||
user: string | null = null; | ||
} | ||
@@ -26,0 +34,0 @@ |
{ | ||
"name": "@hypermode/models-as", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Hypermode Model Interface Library for AssemblyScript", | ||
@@ -17,8 +17,8 @@ "author": "Hypermode, Inc.", | ||
"dependencies": { | ||
"json-as": "^0.8.6" | ||
"json-as": "^0.9.6" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.2", | ||
"@typescript-eslint/eslint-plugin": "^7.13.0", | ||
"@typescript-eslint/parser": "^7.13.0", | ||
"@types/node": "^20.14.4", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"assemblyscript": "^0.27.27", | ||
@@ -25,0 +25,0 @@ "assemblyscript-prettier": "^3.0.1", |
11909
359
+ Addedjson-as@0.9.29(transitive)
- Removedas-container@0.8.0(transitive)
- Removedas-string-sink@0.5.3(transitive)
- Removedas-variant@0.4.1(transitive)
- Removedjson-as@0.8.8(transitive)
Updatedjson-as@^0.9.6