Replies: 2 comments
-
Is there any update on this item? I also have the similar need for the same. |
Beta Was this translation helpful? Give feedback.
0 replies
-
A bit hacky but you can supply your own types into the generic:
Then you can do this:
Remember this is following a builder pattern so you should reassign your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a TypeScript project where I need to dynamically generate a graph based on configurations. Below is a simplified example of my setup:
Agent Configuration Example
I have agent specifications like this:
Node Generation
I generate nodes dynamically from a record of agents like this:
Graph Generation
To create the graph, I use the following function:
The Problem The issue arises with the addEdge method when I try to dynamically add edges using addEdge:
TypeScript throws the following error:
Question How can I dynamically generate the graph and resolve the type issue with addEdge? Is there a way to make the id dynamically typed or enforce the correct type in this scenario?
Any insights or suggestions would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions