-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Grammar generation from example string #25
Open
riya461
wants to merge
13
commits into
blenderskool:main
Choose a base branch
from
riya461:ai
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
AI integration to Console
Added CFG and Provider Integrations
@riya461 is attempting to deploy a commit to the Akash Hamirwasia's projects Team on Vercel. A member of the Team first needs to authorize it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Grammar Generation Feature
Description
This PR addresses issue #14 regarding grammar generation. It introduces a new feature allowing users to generate regular grammars (RG) and context-free grammars (CFG) using natural language input through the editor console.
Prerequisites
New Feature: Grammar Generation
Usage
Users can generate grammars using the following CLI command in the editor console:
generate <grammar_type>< string > --example < example_strings>
<grammar_type>
: rg (Regular Grammar), cfg (Context-Free Grammar), or tm (Turing Machine)<description>
: User input describing the desired grammar or language--example <example_strings>
: Optional. Comma-separated list of example strings accepted by the grammar (enhances generation accuracy)Examples
Generating a regular grammar:
generate rg m number of a's followed by n number of b's | n,m>=0 --example aabb,aaa,b
Generating a context-free grammar:
generate cfg L={num of a in w = num of b in w, w∈{a,b}*} --example aabb,ab,aaabbb
Output
Upon successful generation, the grammar will be printed in a new playground tab corresponding to the specified grammar type.
Configuration
API Setup
.env
file in the root folder with the following variables:VITE_OPENAI_API_KEY=your_openai_apikey
VITE_GROQ_API_KEY=your_groq_apikey
VITE_ANTHROPIC_API_KEY=your_anthropic_apikey
editor/src/ai/providerConfig.ts
Adding New Providers
To add a new AI provider:
NewProvider.ts
) in theProviderList
folderProviderFactory.ts
providerConfig.ts
to include the new provider optionAdditional Changes