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

perf(ai-generator): update csharp ai generator template #12460

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ namespace {{SafeProjectName}}
{
private APIClient Client;

public APIActions(string specPath)
public APIActions()
{
Client = new APIClient(specPath);
Client = new APIClient("{{OPENAPI_SPEC_PATH}}");
}

// Replace with action code

private static IMessageActivity RenderCardToMessage(string cardTemplatePath, string data)
{
try
Expand Down Expand Up @@ -48,7 +50,7 @@ namespace {{SafeProjectName}}
PathObject = args.ContainsKey("path") ? args["path"] : null,
HeaderObject = args.ContainsKey("header") ? args["header"] : null,
QueryObject = args.ContainsKey("query") ? args["query"] : null,
RequestBody = args.ContainsKey("requestBody") ? args["requestBody"] : null
RequestBody = args.ContainsKey("body") ? args["body"] : null
};
return requestParam;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ namespace {{SafeProjectName}}
{
public class APIBot : Application<TurnState>
{
public APIBot(ApplicationOptions<TurnState> options, string specPath) : base(options)
public APIBot(ApplicationOptions<TurnState> options) : base(options)
{
// Registering action handlers that will be hooked up to the planner.
AI.ImportActions(new APIActions(specPath));
AI.ImportActions(new APIActions());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ builder.Services.AddTransient<IBot>(sp =>
Storage = sp.GetService<IStorage>(),
AI = new(planner),
LoggerFactory = loggerFactory,
},
"./apiSpecificationFile/openapi.yaml");
});

bot.OnConversationUpdate("membersAdded", async (turnContext, turnState, cancellationToken) =>
{
Expand Down
Loading