mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Cleanup
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
namespace AGUIDojoClient.Components.Shared;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using Microsoft.Agents.AI.AGUI;
|
||||
using Microsoft.Extensions.AI;
|
||||
@@ -19,8 +19,8 @@ public sealed class DemoService
|
||||
/// <param name="httpClientFactory">Factory for creating HTTP clients.</param>
|
||||
public DemoService(IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_httpClientFactory = httpClientFactory;
|
||||
_scenarios = InitializeScenarios();
|
||||
this._httpClientFactory = httpClientFactory;
|
||||
this._scenarios = InitializeScenarios();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
@@ -27,37 +27,61 @@ public sealed class WeatherInfo
|
||||
/// <summary>
|
||||
/// Gets the temperature in Fahrenheit.
|
||||
/// </summary>
|
||||
public double TemperatureFahrenheit => (Temperature * 9.0 / 5.0) + 32;
|
||||
public double TemperatureFahrenheit => (this.Temperature * 9.0 / 5.0) + 32;
|
||||
|
||||
/// <summary>
|
||||
/// Gets an emoji icon based on weather conditions.
|
||||
/// </summary>
|
||||
public string ConditionIcon => GetConditionIcon(Conditions);
|
||||
public string ConditionIcon => GetConditionIcon(this.Conditions);
|
||||
|
||||
private static string GetConditionIcon(string conditions)
|
||||
{
|
||||
if (string.Equals(conditions, "sunny", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(conditions, "clear", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "☀️";
|
||||
}
|
||||
|
||||
if (string.Equals(conditions, "cloudy", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(conditions, "overcast", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "☁️";
|
||||
}
|
||||
|
||||
if (string.Equals(conditions, "rainy", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(conditions, "rain", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "🌧️";
|
||||
}
|
||||
|
||||
if (string.Equals(conditions, "stormy", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(conditions, "thunderstorm", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "⛈️";
|
||||
}
|
||||
|
||||
if (string.Equals(conditions, "snowy", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(conditions, "snow", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "❄️";
|
||||
}
|
||||
|
||||
if (string.Equals(conditions, "foggy", StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals(conditions, "fog", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "🌫️";
|
||||
}
|
||||
|
||||
if (string.Equals(conditions, "windy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "💨";
|
||||
}
|
||||
|
||||
if (string.Equals(conditions, "partly cloudy", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return "⛅";
|
||||
}
|
||||
|
||||
return "🌡️";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user