-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(code-template): Add Code Template System and Tool Calling Infrastructure #302
feat(code-template): Add Code Template System and Tool Calling Infrastructure #302
Conversation
@wonderwhy-er , sorry but I tried to make the changes as little as possible 😅 |
Also this approach is text based, to it can be used by any llm, as long as it follows the structured output and does not get confused. that require prompt tuning which can be done in separate task we can now add agents for github project import or commit, using this framework |
Ok, will need to take a deeper look in to how it works |
this is an example of git import using the tooling framework Git.Import.using.Tool.Architecture.mp4 |
Ahh its still big, will take time to fully review... |
@thecodacus Awesome work! Thank you for your contribution. Have you had a chance to check out Microsoft's Magnetic-One? It includes an orchestrator that passes commands to specific agents, each designed to handle particular tasks. If you could take a look at it, that might make a fantastic addition to this project. Magnetic-One was recently released, so not many people have seen it yet, but it works really well. Thanks again for your awesome work, I really appreciate it! |
no I didn't get the chance to see that yet. will definitely check that |
This was an awesome addition - Now all I look forward to is the ability to have attachments as reference to the prompts and one click deploy to vercel or other similar platforms!! |
I did not even notice it had github integration in some form. Considering its not oauth based all users of hosted app will have 5k requests per hour We still need to get to oauth variant to work at some point. |
Yes, for code template system, template needs to be downloaded from github. we will need the key, but the api also has some allowance without any key as well. in future we can also modify the agent code to use the tarball download. that will not require any oauth or api key at all for the github project import demo that i showed in the threaded video, was just to show case what we can do with this system, this PR does not contain the github agent included. that is something I just made with this system quickly to showcase |
I am currently facing a NotFoundError in the application, and I need assistance in resolving it. The error message is as follows: php Could anyone help me understand what might be causing this error and guide me on how to resolve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear @thecodacus ,
First off: I am not a maintainer of this project nor have I fully understood all your decisions.
But I very much appreciate your contribution and wanted to show this be reviewing it.
Your PR is quite huge, so I am afraid it might take some time to get it merged. Therefore, I focused on "how could this be easier to merge"
Two things I noted which I personally would welcome in order to keep this project maintainable:
- Along implementing your extensions, you added some improvements (such as adding proper types) which I appreciate a lot. This could be very well be one (or even multiple) separate small PRs.
- I do think that modifying files from an upstream should be reduced as much as possible. Thus, I do think it would help to move blocks of code into separate small files and place them in dedicated folders for
tool
oragent
.
In general, I do like your work a lot and hope my feedback helps to get this merged quicker.
Cheers, Oliver
@@ -85,6 +86,7 @@ interface BaseChatProps { | |||
sendMessage?: (event: React.UIEvent, messageInput?: string) => void; | |||
handleInputChange?: (event: React.ChangeEvent<HTMLTextAreaElement>) => void; | |||
enhancePrompt?: () => void; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some formatting artifacts. Please lint:fix
the source to keep the diff small as possible
@@ -113,8 +115,13 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>( | |||
) => { | |||
const TEXTAREA_MAX_HEIGHT = chatStarted ? 400 : 200; | |||
const [apiKeys, setApiKeys] = useState<Record<string, string>>({}); | |||
const [toolConfig, setToolConfig] = useState<IToolsConfig>({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making it an interface 👍
@@ -136,6 +143,25 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>( | |||
}); | |||
}, []); | |||
|
|||
useEffect(() => { | |||
const config = Cookies.get('bolt.toolsConfig'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about moving this whole piece of logic into a separate file in components/tools
and to have only a single-line-modification here?
/> | ||
{provider && ( | ||
<div className="flex justify-between items-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another candidate for a separate file
|
||
export abstract class BaseTool { | ||
protected webcontainer: Promise<WebContainer>; | ||
constructor(webcontainerPromise: Promise<WebContainer>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't each tool have at least a name so it can identify itself in tool messages
Edit: Now I see that the agent has a name. I think I misunderstood what tool
and agents
are. Could you clarify this a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you said this was not actually part of this PR, as far as I understood ;)
But since this is a viable implementation and doesn't add to the overall modifications, I appreciate it being in here!
@@ -117,6 +117,12 @@ const PROVIDER_LIST: ProviderInfo[] = [ | |||
} | |||
]; | |||
|
|||
const codeTemplates: TemplateInfo[] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be part of either the agent or the toolConfig? I think it should outside this file at least
app/utils/matchPatterns.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also actually independent from this PR, isn't it?
app/utils/types.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here: Move it to app/lib/tools/types.ts
. I doubt that a single types file is best practice.
including one review suggestion Co-authored-by: Oliver Jägle <[email protected]>
This pull request has been marked as stale due to inactivity. If no further activity occurs, it will be closed in 7 days. |
Add Code Template System and Tool Calling Infrastructure
Overview
This PR introduces two major architectural enhancements:
These changes enable more sophisticated project initialization and lay the groundwork for AI-driven tooling capabilities.
Key Changes
1. Template System Implementation
2. Tool Calling Infrastructure
3. Agent System
AgentPromptGenerator
for structured prompt generationAgentOutputParser
for processing tool calls4. UI Enhancements
Technical Implementation
Agent Architecture
Template System
Tool Execution Pipeline
Testing
Migration Impact
Future Enhancements
Preview
Code.Template.Demo.mp4