Skip to content
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

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

Closed
yuye-aws opened this issue Aug 23, 2024 · 4 comments · Fixed by #846
Closed

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

yuye-aws opened this issue Aug 23, 2024 · 4 comments · Fixed by #846
Assignees
Labels
enhancement New feature or request

Comments

@yuye-aws
Copy link
Member

yuye-aws commented Aug 23, 2024

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.

@yuye-aws yuye-aws added enhancement New feature or request untriaged labels Aug 23, 2024
@yuye-aws yuye-aws changed the title [FEATURE] Function getToolsParametersMap should take in connector id [FEATURE] Function getToolsParametersMap in ToolStep should parse connector id Aug 23, 2024
@dbwiddis
Copy link
Member

dbwiddis commented Aug 23, 2024

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

You'd just need to add Connector ID to this line:

Set<String> optionalKeys = Set.of(NAME_FIELD, DESCRIPTION_FIELD, PARAMETERS_FIELD, INCLUDE_OUTPUT_IN_AGENT_RESPONSE);

and add a getter like this:

String type = (String) inputs.get(TYPE);
String name = (String) inputs.get(NAME_FIELD);
String description = (String) inputs.get(DESCRIPTION_FIELD);
Boolean includeOutputInAgentResponse = ParseUtils.parseIfExists(inputs, INCLUDE_OUTPUT_IN_AGENT_RESPONSE, Boolean.class);
Map<String, String> parameters = getToolsParametersMap(inputs.get(PARAMETERS_FIELD), previousNodeInputs, outputs);

and a null-checking builder line like this:

if (name != null) {
builder.name(name);
}
if (description != null) {
builder.description(description);
}
if (parameters != null) {
builder.parameters(parameters);
}
if (includeOutputInAgentResponse != null) {
builder.includeOutputInAgentResponse(includeOutputInAgentResponse);
}

@yuye-aws
Copy link
Member Author

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

@dbwiddis
Copy link
Member

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants