-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make other optional, test image classify
- Loading branch information
Showing
4 changed files
with
91 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
import { classify } from "genaiscript/runtime" | ||
|
||
const res = await classify("The app crashes when I try to upload a file.", { | ||
bug: "a software defect", | ||
feat: "a feature request", | ||
qa: "an inquiry about how to use the software", | ||
}) | ||
const qa = await classify( | ||
"The app crashes when I try to upload a file.", | ||
{ | ||
bug: "a software defect", | ||
feat: "a feature request", | ||
qa: "an inquiry about how to use the software", | ||
}, | ||
{ other: true } | ||
) | ||
|
||
console.log(res) | ||
console.log(qa) | ||
|
||
const joke = await classify( | ||
"Why did the chicken cross the roard? To fry in the sun.", | ||
{ | ||
yes: "funny", | ||
no: "not funny", | ||
} | ||
) | ||
|
||
console.log(joke) | ||
|
||
const robots = await classify( | ||
(_) => _.defImages("src/robots.jpg"), | ||
{ | ||
object: "Depicts objects, machines, robots, toys, ...", | ||
animal: "Animals, pets, monsters", | ||
}, | ||
{ other: true } | ||
) | ||
console.log(robots) |