Comments (5)
Thanks this looks cool i'll dig in deeper. There are two built in output parsers in GenerateText
both are used based on Prompt
metadata for example. the param keyValueResponse: true
enables splitting the response using a colon seperator.
-
Key Value Output:
https://github.com/dosco/minds/blob/50e864f91806c2d723fe6edd46bc3a6a2ecd17d8/src/prompts/extract.ts#L75 -
Tools / Actions but this one is used internally:
https://github.com/dosco/minds/blob/50e864f91806c2d723fe6edd46bc3a6a2ecd17d8/src/prompts/answers.ts#L46
I tend to add features based on uses-cases so will try and figure out some to extending our current output parsing the zod librasry that langchain uses can be used by us as well.
from ax.
just finished a big refactor to make the api simpler to use and extend. also added support for zod. we now have output parser support for plaintext, simple key-value or a zod schema built in.
The prompts are now super-simple and mostly extend from AIPrompt
which does all the heavy lifting. For example see the
https://github.com/dosco/minds/blob/main/src/prompts/zprompt.ts
const prompt = new ZPrompt(zodSchema, actions);
const CustomerResponse = z.object({
data: z
.array(
z.object({
name: z.string().describe('product name'),
units: z.number().describe('units in stock'),
desc: z.string().max(15).describe('product description'),
})
)
.describe('inventory information'),
response: z.string().max(50).describe('customer response'),
});
const prompt = new ZPrompt(CustomerResponse, actions);
from ax.
Are ZPrompt or zod (or grammars) supported currently? I couldn't find anything
from ax.
The whole framework has changed significantly and is now based on the prompt as. a program idea from the Stanford DSP paper. while zod is not supported anymore it's not required you can have typed inputs and outputs on the prompt (prompt signature)
from ax.
And you can use asserts
to integrate with zod if you still need to.
from ax.
Related Issues (20)
- Create a discussion listing business workflows to target HOT 4
- Documentation? HOT 4
- Ask-Question.js HOT 3
- Aws bedrock
- Allow to extend BaseAI HOT 1
- Cohere AI provider error HOT 1
- Azure OpenAI chat/completion call failed
- Add Polyfill for TextDecoderStream to Ensure Compatibility with Bun HOT 4
- Error processing text: Error: Embed model not set when using ollama. HOT 1
- Function calling (using food-search.ts) HOT 8
- prototyping on observable HOT 9
- Error "Image type is not supported in output fields." for Input field HOT 1
- Accessing Stream Chunks (Streamed generation) HOT 2
- Named export 'AxAI' not found when importing HOT 3
- [Guide Request] Production Deployment HOT 1
- Compilation errors HOT 4
- Add Helicone support
- Where to get tracer output? HOT 1
- MIPRO v2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ax.