opensearch-project / flow-framework

OpenSearch plugin that enables builders to innovate AI apps on OpenSearch
Apache License 2.0
32 stars 31 forks source link

[FEATURE] Function getToolsParametersMap in ToolStep should parse connector id #845

Closed yuye-aws closed 1 month ago

yuye-aws commented 1 month ago

Is your feature request related to a problem?

When creating Connector tool with connector_id from previous node inputs, connector id is missing.

What solution would you like?

Add connector_id into the parsing function in ToolStep.

What alternatives have you considered?

A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?

Add any other context or screenshots about the feature request here.

dbwiddis commented 1 month ago

Great request, @yuye-aws . Feel free to submit a PR.

You'd just need to add Connector ID to this line: https://github.com/opensearch-project/flow-framework/blob/3a88199ca5cf353bbe043c4042d699fa88c34082/src/main/java/org/opensearch/flowframework/workflow/ToolStep.java#L51

and add a getter like this: https://github.com/opensearch-project/flow-framework/blob/3a88199ca5cf353bbe043c4042d699fa88c34082/src/main/java/org/opensearch/flowframework/workflow/ToolStep.java#L63-L67

and a null-checking builder line like this: https://github.com/opensearch-project/flow-framework/blob/3a88199ca5cf353bbe043c4042d699fa88c34082/src/main/java/org/opensearch/flowframework/workflow/ToolStep.java#L72-L83

yuye-aws commented 1 month ago

Thanks! TBH, I am new to this repo. Will submit a PR soon.

dbwiddis commented 1 month ago

Let us know if you need any more help! There may be additional steps (not sure if the builder has the setter you need, etc.) but the above steps should get you started!

yuye-aws commented 1 month ago

Thanks. I think the connector_id is just like the model_id. I will implement this feature within function getToolsParametersMap.