Welcome to alphawave Discussions! #6
Replies: 2 comments 4 replies
-
Hello @Stevenic, and everyone else reading this in the future as well! 👋 I'm a software engineer who stumbled upon this awesome AI client while working on a project at my company :) I've been using AlphaWave to automate some of our processes such as the translation of subtitles (think of SRT or VTT files), generating text from audio, then formatting the text into SRT or VTT, there are a few other goals such as getting metadata about the media, or the number of different actors, the percentage of the script for each actor, etc. So I was blown away at how much it helps when interfacing with AI clients, I'm also planning to use it in some side projects I've been working on, and given that the project is just getting started I wanted to help out as much as I can! Though I'm not entirely sure where to start, here are some ideas:
If you have any other ideas let me know! I noticed you mentioned you've been working on the new function calling API in the |
Beta Was this translation helpful? Give feedback.
-
I'm struggling with AI keep calling "python" function and try to maintain the structured data. Then I follow from search to here. It's a great project to help me solve the structure problem. Now I totally give up the function call,I found out its will serious interfering with AI. But here is something I came out within the process, a CompositeValidator that can composite validators together when I need to use function call and structured response at the sametime. interface CompisiteItem {
test: (memory: PromptMemory, functions: PromptFunctions, tokenizer: Tokenizer, response: PromptResponse, remaining_attempts: number) => boolean;
validator: PromptResponseValidator;
}
export class CompositeResponseValidator implements PromptResponseValidator {
constructor(private items: CompisiteItem[]) { }
public async validateResponse(memory: PromptMemory, functions: PromptFunctions, tokenizer: Tokenizer, response: PromptResponse, remaining_attempts: number): Promise<Validation> {
let validator = this.items.find(i => i.test(memory, functions, tokenizer, response, remaining_attempts))?.validator;
if(validator !== undefined){
return validator.validateResponse(memory, functions, tokenizer, response, remaining_attempts);
}else{
return Promise.resolve({
type: 'Validation',
valid: true,
});
}
}
} Then you setup the validators base on different condition. const validator = new CompositeResponseValidator([
{
test: (memory, functions, tokenizer, response, remaining_attempts) => {
return (response.message as Message).function_call !== undefined;
},
validator: new FunctionResponseValidator(model.options.functions),
},
{
test: () => true,
validator: new JSONResponseValidator(task.schema),
},
]); |
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
We’re using Discussions as a place to connect with other members of our community. We hope that you:
build together 💪.
To get started, comment below with an introduction of yourself and tell us about what you do with this community.
Beta Was this translation helpful? Give feedback.
All reactions