Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for v0.5.0 #18

Merged
merged 7 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-hypermode-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: npm install
- name: Build the project
run: npm run build:release
run: npm run build release
- name: Publish GitHub artifact
uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 3 additions & 5 deletions functions/assembly/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { JSON } from "json-as";
import { model } from "@hypermode/functions-as";
import { model, ClassificationResult } from "@hypermode/functions-as";

export function testClassifier(text: string): string {
export function testClassifier(text: string): ClassificationResult {
const modelName = "sentiment-classifier";
const results = model.classifyText(modelName, text);
return JSON.stringify(results);
return model.classifyText(modelName, text);
}
171 changes: 81 additions & 90 deletions functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 7 additions & 10 deletions functions/package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
{
"name": "sample",
"private": true,
"version": "1.1.0",
"version": "1.2.0",
"description": "Hypermode Functions Sample",
"author": "Hypermode, Inc.",
"license": "MIT",
"type": "module",
"scripts": {
"build": "run-script-os",
"build:windows": "asc assembly\\index.ts -o build\\%npm_package_name%.wasm --target debug",
"build:default": "asc assembly/index.ts -o build/$npm_package_name.wasm --target debug",
"build:release": "asc assembly/index.ts -o build/$npm_package_name.wasm --target release",
"build": "node ./node_modules/@hypermode/functions-as/bin/build-plugin.js",
"pretty": "prettier --write .",
"pretty:check": "prettier --check .",
"lint": "eslint --ext .ts .",
"lint:fix": "eslint --ext .ts --fix ."
},
"dependencies": {
"@hypermode/functions-as": "^0.4.0",
"json-as": "^0.8.1"
"@hypermode/functions-as": "^0.5.0",
"json-as": "^0.8.2"
},
"devDependencies": {
"@assemblyscript/wasi-shim": "^0.1.0",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"assemblyscript": "^0.27.25",
"@typescript-eslint/eslint-plugin": "^7.7.0",
"@typescript-eslint/parser": "^7.7.0",
"assemblyscript": "^0.27.27",
"assemblyscript-prettier": "^3.0.1",
"eslint": "^8.57.0",
"prettier": "^3.2.5",
Expand Down
5 changes: 3 additions & 2 deletions hypermode.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
],
"hosts": [
{
"name": "openai"
"endpoint": "https://api.openai.com/v1"
"name": "openai",
"endpoint": "https://api.openai.com/v1",
"authHeader": "x-api-key"
}
]
}
5 changes: 0 additions & 5 deletions schema.graphql

This file was deleted.