Skip to content

Commit

Permalink
feat: ✨ add prediction support and enhance processing
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Dec 27, 2024
1 parent fdae125 commit b5d6267
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/core/src/llms.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@
"id": "azure",
"detail": "Azure OpenAI deployment",
"listModels": false,
"bearerToken": false
"bearerToken": false,
"prediction": false
},
{
"id": "azure_serverless",
"detail": "Azure AI OpenAI (serverless deployments)",
"listModels": false,
"bearerToken": false,
"prediction": false,
"aliases": {
"large": "gpt-4o",
"small": "gpt-4o-mini",
Expand Down
7 changes: 6 additions & 1 deletion packages/sample/genaisrc/dup.genai.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ script({
def("FILE", "hello world")
def("FILE", "hello world")

$`If <FILE> is defined twice in the prompt, respond with FAIL; otherwise respond SUCCESS`
defOutputProcessor((output) => {
const msg = output.messages.find(m => m.role === "user")
console.log({ msg })
const fileCount = (msg.content.match(/<FILE>/g) || []).length;
if (fileCount > 2) throw new Error("Too many files")
})
2 changes: 1 addition & 1 deletion packages/sample/genaisrc/tools.genai.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ defTool(
required: ["location"],
},
({ location }) => {
return location === "Paris" ? "sunny" : "unknown"
return /paris/i.test(location) ? "sunny" : "unknown"
}
)

Expand Down

0 comments on commit b5d6267

Please sign in to comment.