Include chat, weather, image, travel, streaming ASR and text examples, shared model initialization, documentation, and existing tests. Co-authored-by: TRAE CLI <traecli@bytedance.com>
46 lines
1.5 KiB
Go
46 lines
1.5 KiB
Go
package model
|
|
|
|
// WeatherArguments 指定地点,以及可选的预报日期范围。
|
|
type WeatherArguments struct {
|
|
Location string `json:"location"`
|
|
StartDate string `json:"start_date,omitempty"`
|
|
EndDate string `json:"end_date,omitempty"`
|
|
}
|
|
|
|
// WeatherLocations 是 Open-Meteo 的城市搜索结果,使用首个匹配项。
|
|
type WeatherLocations struct {
|
|
Results []struct {
|
|
Name string `json:"name"`
|
|
Admin1 string `json:"admin1"`
|
|
Country string `json:"country"`
|
|
Latitude float64 `json:"latitude"`
|
|
Longitude float64 `json:"longitude"`
|
|
} `json:"results"`
|
|
}
|
|
|
|
// WeatherDailyResponse 只保留本示例使用的逐日预报字段。
|
|
type WeatherDailyResponse struct {
|
|
Daily struct {
|
|
Dates []string `json:"time"`
|
|
Codes []*int `json:"weather_code"`
|
|
MaxTemps []*float64 `json:"temperature_2m_max"`
|
|
MinTemps []*float64 `json:"temperature_2m_min"`
|
|
RainChances []*float64 `json:"precipitation_probability_max"`
|
|
} `json:"daily"`
|
|
}
|
|
|
|
// WeatherForecast 向模型返回实际匹配地点和指定日期的预报。
|
|
type WeatherForecast struct {
|
|
Location string `json:"location"`
|
|
Timezone string `json:"timezone"`
|
|
Days []WeatherDay `json:"days"`
|
|
}
|
|
|
|
type WeatherDay struct {
|
|
Date string `json:"date"`
|
|
Condition string `json:"condition"`
|
|
MinTemperatureC float64 `json:"min_temperature_c"`
|
|
MaxTemperatureC float64 `json:"max_temperature_c"`
|
|
PrecipitationChancePct float64 `json:"precipitation_probability_max_pct"`
|
|
}
|