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

ASP.NET WhoIs example should use IActionResult #21

Closed
paulyuk opened this issue Feb 15, 2024 · 1 comment
Closed

ASP.NET WhoIs example should use IActionResult #21

paulyuk opened this issue Feb 15, 2024 · 1 comment
Assignees

Comments

@paulyuk
Copy link
Member

paulyuk commented Feb 15, 2024

Looking at this example, the code is perfectly fine, just it's not modern ASP.NET like.

[FunctionName(nameof(WhoIs))]
public static string WhoIs(
    [HttpTrigger(AuthorizationLevel.Function, Route = "whois/{name}")] HttpRequest req,
    [TextCompletion("Who is {name}?", Model = "gpt-35-turbo")] TextCompletionResponse response)
{
    return response.Content;
}

Suggest changing this in all places to be this instead:

        [FunctionName(nameof(WhoIs))]
        public static IActionResult WhoIsFunction(
            [HttpTrigger(AuthorizationLevel.Function, Route = "whois/{name}")] HttpRequest req,
            [TextCompletion("Who is {name}?")] TextCompletionResponse response)
        {
            return new OkObjectResult(response.Content);
        }
@manvkaur manvkaur self-assigned this Feb 21, 2024
manvkaur added a commit that referenced this issue Feb 21, 2024
…er (#25)

Reorganised samples into folders for each feature and supported languages underneath
image
Resolved CG vulnerabilities:
Upgrade Microsoft.AspNetCore.Http from 2.1.0 to 2.1.22 to fix the vulnerability.
Removed Microsoft.AspNetCore.Mvc.Core reference from isolated projects
Removed STJ reference from in proc project
Nuget Package Artifact build - PR trigger removed, path trigger updated.
Nuget packages updated in samples C# projects.
Some text updates in README files (more README organisation separately)
Updated host json to include logging for extension WebJobs
Also addressing ASP.NET WhoIs example should use IActionResult #21
Renamed Startup file for Kusto project, removed extra startup file from WebJobs extension
Updated packages for extension projects
Fixed bug in totalTokens, count was not being set
Bumped the version in changelog to 0.9.0
@manvkaur
Copy link
Collaborator

@paulyuk , addressed the issue in above PR, closing the issue now.

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

No branches or pull requests

2 participants