czlai

package module
v0.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

Czlai Go API Library

Go Reference

The Czlai Go library provides convenient access to the Czlai REST API from applications written in Go. The full API of this library can be found in api.md.

It is generated with Stainless.

Installation

import (
	"github.com/CZL-AI/czlai-go" // imported as czlai
)

Or to pin the version:

go get -u 'github.com/CZL-AI/czlai-go@v0.1.0-alpha.1'

Requirements

This library requires Go 1.18+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/CZL-AI/czlai-go"
	"github.com/CZL-AI/czlai-go/option"
)

func main() {
	client := czlai.NewClient(
		option.WithBearerToken("My Bearer Token"), // defaults to os.LookupEnv("BEARER_TOKEN")
		option.WithUsername("My Username"),        // defaults to os.LookupEnv("BASIC_AUTH_USERNAME")
		option.WithPassword("My Password"),        // defaults to os.LookupEnv("BASIC_AUTH_PASSWORD")
	)
	response, err := client.AICheckup.SessionStart(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.Data)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: czlai.F("hello"),

	// Explicitly send `"description": null`
	Description: czlai.Null[string](),

	Point: czlai.F(czlai.Point{
		X: czlai.Int(0),
		Y: czlai.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: czlai.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the repsonse JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := czlai.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.AICheckup.SessionStart(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *czlai.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.AICheckup.SessionStart(context.TODO())
if err != nil {
	var apierr *czlai.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/ai-checkup/session-start": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.AICheckup.SessionStart(
	ctx,
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as param.Field[io.Reader]. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper czlai.FileParam(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := czlai.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.AICheckup.SessionStart(context.TODO(), option.WithMaxRetries(5))
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]interface{}

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   czlai.F("id_xxxx"),
    Data: czlai.F(FooNewParamsData{
        FirstName: czlai.F("John"),
    }),
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := czlai.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals).
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func F

func F[T any](value T) param.Field[T]

F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.

func FileParam

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explicitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type AICheckupIsFirstParams

type AICheckupIsFirstParams struct {
	// 宠物档案 ID
	PetProfileID param.Field[int64] `query:"pet_profile_id,required"`
}

func (AICheckupIsFirstParams) URLQuery

func (r AICheckupIsFirstParams) URLQuery() (v url.Values)

URLQuery serializes AICheckupIsFirstParams's query parameters as `url.Values`.

type AICheckupIsFirstResponse

type AICheckupIsFirstResponse struct {
	Data    AICheckupIsFirstResponseData `json:"data"`
	Message string                       `json:"message"`
	Success bool                         `json:"success"`
	JSON    aiCheckupIsFirstResponseJSON `json:"-"`
}

func (*AICheckupIsFirstResponse) UnmarshalJSON

func (r *AICheckupIsFirstResponse) UnmarshalJSON(data []byte) (err error)

type AICheckupIsFirstResponseData

type AICheckupIsFirstResponseData struct {
	// 是否为当月首检
	IsFirst bool                             `json:"is_first"`
	JSON    aiCheckupIsFirstResponseDataJSON `json:"-"`
}

func (*AICheckupIsFirstResponseData) UnmarshalJSON

func (r *AICheckupIsFirstResponseData) UnmarshalJSON(data []byte) (err error)

type AICheckupPicResultParams

type AICheckupPicResultParams struct {
	// 图片 url
	ImgURL param.Field[string] `json:"img_url,required"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id,required"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
}

func (AICheckupPicResultParams) MarshalJSON

func (r AICheckupPicResultParams) MarshalJSON() (data []byte, err error)

type AICheckupQuestionParams

type AICheckupQuestionParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id,required"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
}

func (AICheckupQuestionParams) MarshalJSON

func (r AICheckupQuestionParams) MarshalJSON() (data []byte, err error)

type AICheckupQuestionResultParams

type AICheckupQuestionResultParams struct {
	// 宠物档案 id
	Index param.Field[int64] `json:"index,required"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id,required"`
	// 回答 id
	QuestionID param.Field[string] `json:"question_id,required"`
	// 题目轮次
	Round param.Field[string] `json:"round,required"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
}

func (AICheckupQuestionResultParams) MarshalJSON

func (r AICheckupQuestionResultParams) MarshalJSON() (data []byte, err error)

type AICheckupReportParams

type AICheckupReportParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id,required"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
}

func (AICheckupReportParams) MarshalJSON

func (r AICheckupReportParams) MarshalJSON() (data []byte, err error)

type AICheckupReportTaskParams

type AICheckupReportTaskParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 报告类型
	ReportType param.Field[int64] `json:"report_type"`
}

func (AICheckupReportTaskParams) MarshalJSON

func (r AICheckupReportTaskParams) MarshalJSON() (data []byte, err error)

type AICheckupService

type AICheckupService struct {
	Options []option.RequestOption
}

AICheckupService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAICheckupService method instead.

func NewAICheckupService

func NewAICheckupService(opts ...option.RequestOption) (r *AICheckupService)

NewAICheckupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AICheckupService) IsFirst

检查是否为当月首检

func (*AICheckupService) PicResult

func (r *AICheckupService) PicResult(ctx context.Context, body AICheckupPicResultParams, opts ...option.RequestOption) (err error)

获取图片结果

func (*AICheckupService) Question

func (r *AICheckupService) Question(ctx context.Context, body AICheckupQuestionParams, opts ...option.RequestOption) (err error)

获取问题

func (*AICheckupService) QuestionResult

func (r *AICheckupService) QuestionResult(ctx context.Context, body AICheckupQuestionResultParams, opts ...option.RequestOption) (err error)

获取问题

func (*AICheckupService) Report

func (r *AICheckupService) Report(ctx context.Context, body AICheckupReportParams, opts ...option.RequestOption) (err error)

获取诊断报告

func (*AICheckupService) ReportTask

func (r *AICheckupService) ReportTask(ctx context.Context, body AICheckupReportTaskParams, opts ...option.RequestOption) (err error)

获取诊断报告

func (*AICheckupService) SessionStart

func (r *AICheckupService) SessionStart(ctx context.Context, opts ...option.RequestOption) (res *AICheckupSessionStartResponse, err error)

开始一个新的会话

func (*AICheckupService) Summary

func (r *AICheckupService) Summary(ctx context.Context, body AICheckupSummaryParams, opts ...option.RequestOption) (res *string, err error)

生成总结

func (*AICheckupService) UpdateProfile

更新宠物档案的体检参数

type AICheckupSessionStartResponse

type AICheckupSessionStartResponse struct {
	Data    AICheckupSessionStartResponseData `json:"data"`
	Message string                            `json:"message"`
	Success bool                              `json:"success"`
	JSON    aiCheckupSessionStartResponseJSON `json:"-"`
}

func (*AICheckupSessionStartResponse) UnmarshalJSON

func (r *AICheckupSessionStartResponse) UnmarshalJSON(data []byte) (err error)

type AICheckupSessionStartResponseData

type AICheckupSessionStartResponseData struct {
	SessionID string                                `json:"session_id"`
	JSON      aiCheckupSessionStartResponseDataJSON `json:"-"`
}

func (*AICheckupSessionStartResponseData) UnmarshalJSON

func (r *AICheckupSessionStartResponseData) UnmarshalJSON(data []byte) (err error)

type AICheckupSummaryParams

type AICheckupSummaryParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AICheckupSummaryParams) MarshalJSON

func (r AICheckupSummaryParams) MarshalJSON() (data []byte, err error)

type AICheckupUpdateProfileParams

type AICheckupUpdateProfileParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
	// 更新类型, 可选 1,2,3
	UpdateType param.Field[int64] `json:"update_type"`
}

func (AICheckupUpdateProfileParams) MarshalJSON

func (r AICheckupUpdateProfileParams) MarshalJSON() (data []byte, err error)

type AICheckupUpdateProfileResponse

type AICheckupUpdateProfileResponse struct {
	Data    interface{}                        `json:"data"`
	Message string                             `json:"message"`
	Success bool                               `json:"success"`
	JSON    aiCheckupUpdateProfileResponseJSON `json:"-"`
}

func (*AICheckupUpdateProfileResponse) UnmarshalJSON

func (r *AICheckupUpdateProfileResponse) UnmarshalJSON(data []byte) (err error)

type AIConvAnswerParams

type AIConvAnswerParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
	// 用户输入
	UserInput param.Field[string] `json:"user_input"`
}

func (AIConvAnswerParams) MarshalJSON

func (r AIConvAnswerParams) MarshalJSON() (data []byte, err error)

type AIConvRelationParams

type AIConvRelationParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
	// 用户输入
	UserInput param.Field[string] `json:"user_input"`
}

func (AIConvRelationParams) MarshalJSON

func (r AIConvRelationParams) MarshalJSON() (data []byte, err error)

type AIConvService

type AIConvService struct {
	Options []option.RequestOption
}

AIConvService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAIConvService method instead.

func NewAIConvService

func NewAIConvService(opts ...option.RequestOption) (r *AIConvService)

NewAIConvService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AIConvService) Answer

func (r *AIConvService) Answer(ctx context.Context, body AIConvAnswerParams, opts ...option.RequestOption) (res *string, err error)

AI 聊天

func (*AIConvService) Relation

func (r *AIConvService) Relation(ctx context.Context, body AIConvRelationParams, opts ...option.RequestOption) (err error)

获取联想

func (*AIConvService) Validate

func (r *AIConvService) Validate(ctx context.Context, body AIConvValidateParams, opts ...option.RequestOption) (err error)

AI 聊天校验

type AIConvValidateParams

type AIConvValidateParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
	// 用户输入
	UserInput param.Field[string] `json:"user_input"`
}

func (AIConvValidateParams) MarshalJSON

func (r AIConvValidateParams) MarshalJSON() (data []byte, err error)

type AIMeme

type AIMeme struct {
	ID        int64         `json:"id"`
	Context   AIMemeContext `json:"context"`
	CreatedAt string        `json:"created_at"`
	// 表情包 url 列表
	MemeImage interface{} `json:"meme_image"`
	// 原始图片列表
	OriginImage string     `json:"origin_image"`
	UpdatedAt   string     `json:"updated_at"`
	JSON        aiMemeJSON `json:"-"`
}

func (*AIMeme) UnmarshalJSON

func (r *AIMeme) UnmarshalJSON(data []byte) (err error)

type AIMemeContext

type AIMemeContext struct {
	CaptionList []string `json:"caption_list"`
	// 1 表示是猫或狗,2 表示非猫狗的动植物,0 表示不是动植物。
	IsCatOrDog int64 `json:"is_cat_or_dog"`
	// 1 表示是合法的,0 表示不合法。
	IsLegal int64             `json:"is_legal"`
	JSON    aiMemeContextJSON `json:"-"`
}

func (*AIMemeContext) UnmarshalJSON

func (r *AIMemeContext) UnmarshalJSON(data []byte) (err error)

type AIMemeGenerateParams

type AIMemeGenerateParams struct {
	// 文案序号
	ContextIndex param.Field[int64] `json:"context_index"`
	// 表情包 id
	MemeID param.Field[int64] `json:"meme_id"`
}

func (AIMemeGenerateParams) MarshalJSON

func (r AIMemeGenerateParams) MarshalJSON() (data []byte, err error)

type AIMemeGenerateResponse

type AIMemeGenerateResponse struct {
	Data    AIMemeGenerateResponseData `json:"data"`
	Message string                     `json:"message"`
	Success bool                       `json:"success"`
	JSON    aiMemeGenerateResponseJSON `json:"-"`
}

func (*AIMemeGenerateResponse) UnmarshalJSON

func (r *AIMemeGenerateResponse) UnmarshalJSON(data []byte) (err error)

type AIMemeGenerateResponseData

type AIMemeGenerateResponseData struct {
	// 表情包地址
	MemeURL string                         `json:"meme_url"`
	JSON    aiMemeGenerateResponseDataJSON `json:"-"`
}

func (*AIMemeGenerateResponseData) UnmarshalJSON

func (r *AIMemeGenerateResponseData) UnmarshalJSON(data []byte) (err error)

type AIMemeGetParams

type AIMemeGetParams struct {
	// 每页数量
	Limit param.Field[int64] `query:"limit"`
	// 页数
	Page param.Field[int64] `query:"page"`
}

func (AIMemeGetParams) URLQuery

func (r AIMemeGetParams) URLQuery() (v url.Values)

URLQuery serializes AIMemeGetParams's query parameters as `url.Values`.

type AIMemeGetResponse

type AIMemeGetResponse struct {
	Data    []AIMeme              `json:"data"`
	Message string                `json:"message"`
	Success bool                  `json:"success"`
	JSON    aiMemeGetResponseJSON `json:"-"`
}

func (*AIMemeGetResponse) UnmarshalJSON

func (r *AIMemeGetResponse) UnmarshalJSON(data []byte) (err error)

type AIMemeNewParams

type AIMemeNewParams struct {
	// 图片地址
	ImageURL param.Field[string] `json:"image_url"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AIMemeNewParams) MarshalJSON

func (r AIMemeNewParams) MarshalJSON() (data []byte, err error)

type AIMemeNewResponse

type AIMemeNewResponse struct {
	Data    AIMeme                `json:"data"`
	Message string                `json:"message"`
	Success bool                  `json:"success"`
	JSON    aiMemeNewResponseJSON `json:"-"`
}

func (*AIMemeNewResponse) UnmarshalJSON

func (r *AIMemeNewResponse) UnmarshalJSON(data []byte) (err error)

type AIMemeService

type AIMemeService struct {
	Options []option.RequestOption
}

AIMemeService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAIMemeService method instead.

func NewAIMemeService

func NewAIMemeService(opts ...option.RequestOption) (r *AIMemeService)

NewAIMemeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AIMemeService) Generate

获取 AI 表情包

func (*AIMemeService) Get

func (r *AIMemeService) Get(ctx context.Context, query AIMemeGetParams, opts ...option.RequestOption) (res *AIMemeGetResponse, err error)

获取用户历史表情包数据列表

func (*AIMemeService) New

获取表情包数据

type AITrialOptionsParams

type AITrialOptionsParams struct {
	// 问题
	Question param.Field[string] `json:"question"`
	// 1-猫狗 2-异宠
	ServiceType param.Field[int64] `json:"service_type"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AITrialOptionsParams) MarshalJSON

func (r AITrialOptionsParams) MarshalJSON() (data []byte, err error)

type AITrialQuestionParams

type AITrialQuestionParams struct {
	// 1-猫狗 2-异宠
	ServiceType param.Field[int64] `json:"service_type"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AITrialQuestionParams) MarshalJSON

func (r AITrialQuestionParams) MarshalJSON() (data []byte, err error)

type AITrialService

type AITrialService struct {
	Options []option.RequestOption
}

AITrialService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAITrialService method instead.

func NewAITrialService

func NewAITrialService(opts ...option.RequestOption) (r *AITrialService)

NewAITrialService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AITrialService) OptionsFunc

func (r *AITrialService) OptionsFunc(ctx context.Context, body AITrialOptionsParams, opts ...option.RequestOption) (err error)

获取问题选项

func (*AITrialService) Question

func (r *AITrialService) Question(ctx context.Context, body AITrialQuestionParams, opts ...option.RequestOption) (err error)

获取问题(流式)

type AidocExoticAskContinueParams

type AidocExoticAskContinueParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocExoticAskContinueParams) MarshalJSON

func (r AidocExoticAskContinueParams) MarshalJSON() (data []byte, err error)

type AidocExoticIfNeedImageParams

type AidocExoticIfNeedImageParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocExoticIfNeedImageParams) MarshalJSON

func (r AidocExoticIfNeedImageParams) MarshalJSON() (data []byte, err error)

type AidocExoticIfNeedImageResponse

type AidocExoticIfNeedImageResponse = interface{}

type AidocExoticKeywordsParams

type AidocExoticKeywordsParams struct {
	// 用户主诉
	Content param.Field[string] `json:"content"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocExoticKeywordsParams) MarshalJSON

func (r AidocExoticKeywordsParams) MarshalJSON() (data []byte, err error)

type AidocExoticKeywordsResponse

type AidocExoticKeywordsResponse struct {
	Data    AidocExoticKeywordsResponseData `json:"data"`
	Message string                          `json:"message"`
	Success bool                            `json:"success"`
	JSON    aidocExoticKeywordsResponseJSON `json:"-"`
}

func (*AidocExoticKeywordsResponse) UnmarshalJSON

func (r *AidocExoticKeywordsResponse) UnmarshalJSON(data []byte) (err error)

type AidocExoticKeywordsResponseData

type AidocExoticKeywordsResponseData struct {
	// 关键词
	Keywords string `json:"keywords"`
	// 科室
	Unit string                              `json:"unit"`
	JSON aidocExoticKeywordsResponseDataJSON `json:"-"`
}

func (*AidocExoticKeywordsResponseData) UnmarshalJSON

func (r *AidocExoticKeywordsResponseData) UnmarshalJSON(data []byte) (err error)

type AidocExoticOptionsParams

type AidocExoticOptionsParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 问题
	Question param.Field[string] `json:"question"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocExoticOptionsParams) MarshalJSON

func (r AidocExoticOptionsParams) MarshalJSON() (data []byte, err error)

type AidocExoticPicResultParams

type AidocExoticPicResultParams struct {
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocExoticPicResultParams) MarshalJSON

func (r AidocExoticPicResultParams) MarshalJSON() (data []byte, err error)

type AidocExoticQuestionParams

type AidocExoticQuestionParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocExoticQuestionParams) MarshalJSON

func (r AidocExoticQuestionParams) MarshalJSON() (data []byte, err error)

type AidocExoticReportParams

type AidocExoticReportParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
}

func (AidocExoticReportParams) MarshalJSON

func (r AidocExoticReportParams) MarshalJSON() (data []byte, err error)

type AidocExoticReportTaskParams

type AidocExoticReportTaskParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 报告类型
	ReportType param.Field[int64] `json:"report_type"`
}

func (AidocExoticReportTaskParams) MarshalJSON

func (r AidocExoticReportTaskParams) MarshalJSON() (data []byte, err error)

type AidocExoticService

type AidocExoticService struct {
	Options []option.RequestOption
}

AidocExoticService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAidocExoticService method instead.

func NewAidocExoticService

func NewAidocExoticService(opts ...option.RequestOption) (r *AidocExoticService)

NewAidocExoticService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AidocExoticService) AskContinue

func (r *AidocExoticService) AskContinue(ctx context.Context, body AidocExoticAskContinueParams, opts ...option.RequestOption) (res *string, err error)

判断是否需要继续提问

func (*AidocExoticService) IfNeedImage

判断是否需要传图

func (*AidocExoticService) Keywords

获取关键词,科室

func (*AidocExoticService) OptionsFunc

func (r *AidocExoticService) OptionsFunc(ctx context.Context, body AidocExoticOptionsParams, opts ...option.RequestOption) (res *string, err error)

获取问题选项

func (*AidocExoticService) PicResult

获取图片结果(流式)

func (*AidocExoticService) Question

func (r *AidocExoticService) Question(ctx context.Context, body AidocExoticQuestionParams, opts ...option.RequestOption) (res *string, err error)

获取问题(流式)

func (*AidocExoticService) Report

发布获取诊断报告任务

func (*AidocExoticService) ReportTask

获取诊断报告

func (*AidocExoticService) Summarize

获取病情小结(流式)

type AidocExoticSummarizeParams

type AidocExoticSummarizeParams struct {
	// 图片地址
	ImageURL param.Field[string] `json:"image_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocExoticSummarizeParams) MarshalJSON

func (r AidocExoticSummarizeParams) MarshalJSON() (data []byte, err error)

type AidocIfContinueAskParams

type AidocIfContinueAskParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocIfContinueAskParams) MarshalJSON

func (r AidocIfContinueAskParams) MarshalJSON() (data []byte, err error)

type AidocIfNeedImageParams

type AidocIfNeedImageParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocIfNeedImageParams) MarshalJSON

func (r AidocIfNeedImageParams) MarshalJSON() (data []byte, err error)

type AidocIfNeedImageResponse

type AidocIfNeedImageResponse = interface{}

type AidocPicResultParams

type AidocPicResultParams struct {
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AidocPicResultParams) MarshalJSON

func (r AidocPicResultParams) MarshalJSON() (data []byte, err error)

type AidocReportParams

type AidocReportParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
}

func (AidocReportParams) MarshalJSON

func (r AidocReportParams) MarshalJSON() (data []byte, err error)

type AidocReportTaskParams

type AidocReportTaskParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 报告类型
	ReportType param.Field[int64] `json:"report_type"`
}

func (AidocReportTaskParams) MarshalJSON

func (r AidocReportTaskParams) MarshalJSON() (data []byte, err error)

type AidocService

type AidocService struct {
	Options []option.RequestOption
}

AidocService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAidocService method instead.

func NewAidocService

func NewAidocService(opts ...option.RequestOption) (r *AidocService)

NewAidocService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AidocService) IfContinueAsk

func (r *AidocService) IfContinueAsk(ctx context.Context, body AidocIfContinueAskParams, opts ...option.RequestOption) (res *string, err error)

判断是否需要继续提问

func (*AidocService) IfNeedImage

判断是否需要传图

func (*AidocService) PicResult

func (r *AidocService) PicResult(ctx context.Context, body AidocPicResultParams, opts ...option.RequestOption) (err error)

获取图片结果(流式)

func (*AidocService) Report

func (r *AidocService) Report(ctx context.Context, body AidocReportParams, opts ...option.RequestOption) (err error)

发布获取诊断报告任务

func (*AidocService) ReportTask

func (r *AidocService) ReportTask(ctx context.Context, body AidocReportTaskParams, opts ...option.RequestOption) (err error)

获取诊断报告

type AipicExoticOptionsParams

type AipicExoticOptionsParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 问题
	Question param.Field[string] `json:"question"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicExoticOptionsParams) MarshalJSON

func (r AipicExoticOptionsParams) MarshalJSON() (data []byte, err error)

type AipicExoticPicResultParams

type AipicExoticPicResultParams struct {
	// 图片归属(1:宠物品种分析、2:宠物表情分析)
	ImgBelong param.Field[int64] `json:"img_belong"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicExoticPicResultParams) MarshalJSON

func (r AipicExoticPicResultParams) MarshalJSON() (data []byte, err error)

type AipicExoticQuestionParams

type AipicExoticQuestionParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicExoticQuestionParams) MarshalJSON

func (r AipicExoticQuestionParams) MarshalJSON() (data []byte, err error)

type AipicExoticReportParams

type AipicExoticReportParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 图片归属(1:宠物体态分析、2:宠物表情分析、3:牙齿分析)
	SubModuleType param.Field[int64] `json:"sub_module_type"`
}

func (AipicExoticReportParams) MarshalJSON

func (r AipicExoticReportParams) MarshalJSON() (data []byte, err error)

type AipicExoticReportTaskParams

type AipicExoticReportTaskParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 报告类型
	ReportType param.Field[int64] `json:"report_type"`
}

func (AipicExoticReportTaskParams) MarshalJSON

func (r AipicExoticReportTaskParams) MarshalJSON() (data []byte, err error)

type AipicExoticService

type AipicExoticService struct {
	Options []option.RequestOption
}

AipicExoticService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAipicExoticService method instead.

func NewAipicExoticService

func NewAipicExoticService(opts ...option.RequestOption) (r *AipicExoticService)

NewAipicExoticService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AipicExoticService) OptionsFunc

func (r *AipicExoticService) OptionsFunc(ctx context.Context, body AipicExoticOptionsParams, opts ...option.RequestOption) (err error)

获取问题选项

func (*AipicExoticService) PicResult

获取图片结果(流式)

func (*AipicExoticService) Question

获取问题(流式)

func (*AipicExoticService) Report

获取诊断报告

func (*AipicExoticService) ReportTask

获取诊断报告

func (*AipicExoticService) Summary

获取小结(流式)

func (*AipicExoticService) Validate

验证答案是否有效

type AipicExoticSummaryParams

type AipicExoticSummaryParams struct {
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
	// 图片归属(1:宠物体态分析、2:宠物表情分析)
	SubModuleType param.Field[int64] `json:"sub_module_type"`
}

func (AipicExoticSummaryParams) MarshalJSON

func (r AipicExoticSummaryParams) MarshalJSON() (data []byte, err error)

type AipicExoticValidateParams

type AipicExoticValidateParams struct {
	// 用户回答
	Answer param.Field[string] `json:"answer"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 问题
	Question param.Field[string] `json:"question"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicExoticValidateParams) MarshalJSON

func (r AipicExoticValidateParams) MarshalJSON() (data []byte, err error)

type AipicOptionsParams

type AipicOptionsParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 问题
	Question param.Field[string] `json:"question"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicOptionsParams) MarshalJSON

func (r AipicOptionsParams) MarshalJSON() (data []byte, err error)

type AipicPicResultParams

type AipicPicResultParams struct {
	// 图片归属(1:宠物体态分析、2:宠物表情分析)
	ImgBelong param.Field[int64] `json:"img_belong"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicPicResultParams) MarshalJSON

func (r AipicPicResultParams) MarshalJSON() (data []byte, err error)

type AipicQuestionParams

type AipicQuestionParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicQuestionParams) MarshalJSON

func (r AipicQuestionParams) MarshalJSON() (data []byte, err error)

type AipicReportParams

type AipicReportParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 图片归属(1:宠物体态分析、2:宠物表情分析、3:牙齿分析)
	SubModuleType param.Field[int64] `json:"sub_module_type"`
}

func (AipicReportParams) MarshalJSON

func (r AipicReportParams) MarshalJSON() (data []byte, err error)

type AipicReportTaskParams

type AipicReportTaskParams struct {
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 报告类型
	ReportType param.Field[int64] `json:"report_type"`
}

func (AipicReportTaskParams) MarshalJSON

func (r AipicReportTaskParams) MarshalJSON() (data []byte, err error)

type AipicService

type AipicService struct {
	Options []option.RequestOption
}

AipicService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAipicService method instead.

func NewAipicService

func NewAipicService(opts ...option.RequestOption) (r *AipicService)

NewAipicService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AipicService) OptionsFunc

func (r *AipicService) OptionsFunc(ctx context.Context, body AipicOptionsParams, opts ...option.RequestOption) (err error)

获取问题选项

func (*AipicService) PicResult

func (r *AipicService) PicResult(ctx context.Context, body AipicPicResultParams, opts ...option.RequestOption) (err error)

获取图片结果(流式)

func (*AipicService) Question

func (r *AipicService) Question(ctx context.Context, body AipicQuestionParams, opts ...option.RequestOption) (err error)

获取问题(流式)

func (*AipicService) Report

func (r *AipicService) Report(ctx context.Context, body AipicReportParams, opts ...option.RequestOption) (err error)

获取诊断报告

func (*AipicService) ReportTask

func (r *AipicService) ReportTask(ctx context.Context, body AipicReportTaskParams, opts ...option.RequestOption) (err error)

获取诊断报告

func (*AipicService) Validate

func (r *AipicService) Validate(ctx context.Context, body AipicValidateParams, opts ...option.RequestOption) (err error)

验证答案是否有效

type AipicValidateParams

type AipicValidateParams struct {
	// 用户回答
	Answer param.Field[string] `json:"answer"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 问题
	Question param.Field[string] `json:"question"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (AipicValidateParams) MarshalJSON

func (r AipicValidateParams) MarshalJSON() (data []byte, err error)

type BuriedpointNewParams

type BuriedpointNewParams struct {
	// 参数
	Point param.Field[string] `json:"point,required"`
	// 微信 code
	Code param.Field[string] `json:"code"`
}

func (BuriedpointNewParams) MarshalJSON

func (r BuriedpointNewParams) MarshalJSON() (data []byte, err error)

type BuriedpointService

type BuriedpointService struct {
	Options []option.RequestOption
}

BuriedpointService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBuriedpointService method instead.

func NewBuriedpointService

func NewBuriedpointService(opts ...option.RequestOption) (r *BuriedpointService)

NewBuriedpointService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*BuriedpointService) New

保存页埋点

type CheckPointNewParams

type CheckPointNewParams struct {
	// 埋点动作
	Action param.Field[string] `json:"action"`
	// 微信 code
	Code param.Field[string] `json:"code"`
	// 页面路径
	PagePath param.Field[string] `json:"page_path"`
	// 关联 id
	RelatedID param.Field[string] `json:"related_id"`
}

func (CheckPointNewParams) MarshalJSON

func (r CheckPointNewParams) MarshalJSON() (data []byte, err error)

type CheckPointService

type CheckPointService struct {
	Options []option.RequestOption
}

CheckPointService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCheckPointService method instead.

func NewCheckPointService

func NewCheckPointService(opts ...option.RequestOption) (r *CheckPointService)

NewCheckPointService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CheckPointService) New

埋点

type Client

type Client struct {
	Options            []option.RequestOption
	Aidoc              *AidocService
	AidocExotic        *AidocExoticService
	SessionRecords     *SessionRecordService
	MedicalRecords     *MedicalRecordService
	AICheckup          *AICheckupService
	AIConv             *AIConvService
	Users              *UserService
	Upload             *UploadService
	UploadImage        *UploadImageService
	UploadImageOss     *UploadImageOssService
	PetProfiles        *PetProfileService
	AIMemes            *AIMemeService
	MedicationAnalysis *MedicationAnalysisService
	Aipic              *AipicService
	Aipics             *AipicService
	AipicExotics       *AipicExoticService
	AITrials           *AITrialService
	AITrial            *AITrialService
	Policies           *PolicyService
	MagnumKeys         *MagnumKeyService
	Buriedpoints       *BuriedpointService
	Whitelist          *WhitelistService
	Pets               *PetService
	UserModuleUsages   *UserModuleUsageService
	Logins             *LoginService
	UserPoints         *UserPointService
	PointPrices        *PointPriceService
	PointDetails       *PointDetailService
	PointTasks         *PointTaskService
	CheckPoints        *CheckPointService
	UserAdvices        *UserAdviceService
	Evaluation         *EvaluationService
}

Client creates a struct with services and top level methods that help with interacting with the czlai API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r *Client)

NewClient generates a new client with the default option read from the environment (BEARER_TOKEN, BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type Error

type Error = apierror.Error

type EvaluationPutEvaluationParams

type EvaluationPutEvaluationParams struct {
	// 文本内容
	Content param.Field[string] `json:"content,required"`
	// 评价 id
	Evaluation param.Field[int64] `json:"evaluation,required"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
}

func (EvaluationPutEvaluationParams) MarshalJSON

func (r EvaluationPutEvaluationParams) MarshalJSON() (data []byte, err error)

type EvaluationService

type EvaluationService struct {
	Options []option.RequestOption
}

EvaluationService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEvaluationService method instead.

func NewEvaluationService

func NewEvaluationService(opts ...option.RequestOption) (r *EvaluationService)

NewEvaluationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EvaluationService) PutEvaluation

func (r *EvaluationService) PutEvaluation(ctx context.Context, body EvaluationPutEvaluationParams, opts ...option.RequestOption) (err error)

修改评价

type LoginResponse

type LoginResponse struct {
	AuthTokens LoginResponseAuthTokens `json:"authTokens"`
	Message    string                  `json:"message"`
	Success    bool                    `json:"success"`
	JSON       loginResponseJSON       `json:"-"`
}

func (*LoginResponse) UnmarshalJSON

func (r *LoginResponse) UnmarshalJSON(data []byte) (err error)

type LoginResponseAuthTokens

type LoginResponseAuthTokens struct {
	AccessToken  string                      `json:"accessToken,required"`
	RefreshToken string                      `json:"refreshToken,required"`
	JSON         loginResponseAuthTokensJSON `json:"-"`
}

func (*LoginResponseAuthTokens) UnmarshalJSON

func (r *LoginResponseAuthTokens) UnmarshalJSON(data []byte) (err error)

type LoginSMSParams

type LoginSMSParams struct {
	Code  param.Field[string] `json:"code,required"`
	Phone param.Field[string] `json:"phone,required"`
	// 1-微信小程序 2-安卓 APP 3-IOS APP
	LoginFrom param.Field[int64] `json:"login_from"`
}

func (LoginSMSParams) MarshalJSON

func (r LoginSMSParams) MarshalJSON() (data []byte, err error)

type LoginService

type LoginService struct {
	Options []option.RequestOption
}

LoginService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLoginService method instead.

func NewLoginService

func NewLoginService(opts ...option.RequestOption) (r *LoginService)

NewLoginService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*LoginService) SMS

func (r *LoginService) SMS(ctx context.Context, body LoginSMSParams, opts ...option.RequestOption) (res *LoginResponse, err error)

短信登录

func (*LoginService) Wechat

func (r *LoginService) Wechat(ctx context.Context, body LoginWechatParams, opts ...option.RequestOption) (err error)

Logs in the user by WeChat

type LoginWechatParams

type LoginWechatParams struct {
	// 会话 id
	WechatCode param.Field[string] `json:"wechat_code,required"`
	// 加密数据
	EncryptedData param.Field[string] `json:"encryptedData"`
	// 加密初始向量
	Iv param.Field[string] `json:"iv"`
	// 模块类型 1-智能问诊 2-健康检测 3-用药分析 4-知识问答 5-图片识别
	ModuleType param.Field[int64] `json:"module_type"`
	// 手机号
	PhoneNumber param.Field[string] `json:"phone_number"`
	// 推广人 sid
	SpreadID param.Field[int64] `json:"spread_id"`
}

func (LoginWechatParams) MarshalJSON

func (r LoginWechatParams) MarshalJSON() (data []byte, err error)

type MagnumKeyGetKeyParams

type MagnumKeyGetKeyParams struct {
	// 文本
	Context param.Field[string] `json:"context"`
}

func (MagnumKeyGetKeyParams) MarshalJSON

func (r MagnumKeyGetKeyParams) MarshalJSON() (data []byte, err error)

type MagnumKeyPictureChoiceParams

type MagnumKeyPictureChoiceParams struct {
	// 图片 url
	ImgURL param.Field[string] `json:"img_url,required"`
	// 会话 id
	KeyUsageID param.Field[string] `json:"key_usage_id"`
	// 用户 uuid
	UserUuid param.Field[string] `json:"user_uuid"`
}

func (MagnumKeyPictureChoiceParams) MarshalJSON

func (r MagnumKeyPictureChoiceParams) MarshalJSON() (data []byte, err error)

type MagnumKeyPictureQuestionParams

type MagnumKeyPictureQuestionParams struct {
	// 图片 url
	ImgURL param.Field[string] `json:"img_url,required"`
	// 会话 id
	KeyUsageID param.Field[string] `json:"key_usage_id"`
	// 用户 uuid
	UserUuid param.Field[string] `json:"user_uuid"`
}

func (MagnumKeyPictureQuestionParams) MarshalJSON

func (r MagnumKeyPictureQuestionParams) MarshalJSON() (data []byte, err error)

type MagnumKeyService

type MagnumKeyService struct {
	Options []option.RequestOption
}

MagnumKeyService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMagnumKeyService method instead.

func NewMagnumKeyService

func NewMagnumKeyService(opts ...option.RequestOption) (r *MagnumKeyService)

NewMagnumKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MagnumKeyService) GetKey

func (r *MagnumKeyService) GetKey(ctx context.Context, body MagnumKeyGetKeyParams, opts ...option.RequestOption) (err error)

获取 key_usage_id

func (*MagnumKeyService) PictureChoice

func (r *MagnumKeyService) PictureChoice(ctx context.Context, body MagnumKeyPictureChoiceParams, opts ...option.RequestOption) (err error)

获取图片选项

func (*MagnumKeyService) PictureQuestion

func (r *MagnumKeyService) PictureQuestion(ctx context.Context, body MagnumKeyPictureQuestionParams, opts ...option.RequestOption) (err error)

获取图片问题

func (*MagnumKeyService) VoiceChoice

func (r *MagnumKeyService) VoiceChoice(ctx context.Context, body MagnumKeyVoiceChoiceParams, opts ...option.RequestOption) (err error)

获取声音选项

func (*MagnumKeyService) VoiceQuestion

func (r *MagnumKeyService) VoiceQuestion(ctx context.Context, body MagnumKeyVoiceQuestionParams, opts ...option.RequestOption) (err error)

获取声音问题

type MagnumKeyVoiceChoiceParams

type MagnumKeyVoiceChoiceParams struct {
	// 获取声音选项
	Message param.Field[string] `json:"message,required"`
	// 会话 id
	KeyUsageID param.Field[string] `json:"key_usage_id"`
	// 用户 uuid
	UserUuid param.Field[string] `json:"user_uuid"`
}

func (MagnumKeyVoiceChoiceParams) MarshalJSON

func (r MagnumKeyVoiceChoiceParams) MarshalJSON() (data []byte, err error)

type MagnumKeyVoiceQuestionParams

type MagnumKeyVoiceQuestionParams struct {
	// 语音文本
	Message param.Field[string] `json:"message,required"`
	// 会话 id
	KeyUsageID param.Field[string] `json:"key_usage_id"`
	// 宠物 id
	PetID param.Field[int64] `json:"pet_id"`
	// 用户 uuid
	UserUuid param.Field[string] `json:"user_uuid"`
}

func (MagnumKeyVoiceQuestionParams) MarshalJSON

func (r MagnumKeyVoiceQuestionParams) MarshalJSON() (data []byte, err error)

type MedicalRecord

type MedicalRecord struct {
	// 主键 ID
	ID int64 `json:"id"`
	// 创建时间
	CreatedAt time.Time `json:"created_at,nullable" format:"date-time"`
	// 模块 1-智能问诊 2-健康检测
	ModuleType int64 `json:"module_type,nullable"`
	// 报告
	Report string `json:"report,nullable"`
	// 对应的 session_id
	SessionID string `json:"session_id,nullable"`
	// 小结
	Summary string `json:"summary,nullable"`
	// 用户 uuid
	UserUuid string            `json:"user_uuid,nullable"`
	JSON     medicalRecordJSON `json:"-"`
}

func (*MedicalRecord) UnmarshalJSON

func (r *MedicalRecord) UnmarshalJSON(data []byte) (err error)

type MedicalRecordGetParams

type MedicalRecordGetParams struct {
	// 报告 ID
	ReportID param.Field[int64] `query:"report_id,required"`
}

func (MedicalRecordGetParams) URLQuery

func (r MedicalRecordGetParams) URLQuery() (v url.Values)

URLQuery serializes MedicalRecordGetParams's query parameters as `url.Values`.

type MedicalRecordGetResponse

type MedicalRecordGetResponse struct {
	Data    MedicalRecord                `json:"data"`
	Message string                       `json:"message"`
	Success bool                         `json:"success"`
	JSON    medicalRecordGetResponseJSON `json:"-"`
}

func (*MedicalRecordGetResponse) UnmarshalJSON

func (r *MedicalRecordGetResponse) UnmarshalJSON(data []byte) (err error)

type MedicalRecordNewListParams

type MedicalRecordNewListParams struct {
	// 每页数量
	Limit      param.Field[int64]   `json:"limit"`
	ModuleType param.Field[[]int64] `json:"module_type"`
	// 页码
	Page param.Field[int64] `json:"page"`
	// 宠物档案 id
	PetProfileID param.Field[[]int64] `json:"pet_profile_id"`
}

func (MedicalRecordNewListParams) MarshalJSON

func (r MedicalRecordNewListParams) MarshalJSON() (data []byte, err error)

type MedicalRecordNewListResponse

type MedicalRecordNewListResponse struct {
	Data    []MedicalRecord                  `json:"data"`
	Message string                           `json:"message"`
	Success bool                             `json:"success"`
	JSON    medicalRecordNewListResponseJSON `json:"-"`
}

func (*MedicalRecordNewListResponse) UnmarshalJSON

func (r *MedicalRecordNewListResponse) UnmarshalJSON(data []byte) (err error)

type MedicalRecordOngoingRecordParams

type MedicalRecordOngoingRecordParams struct {
	// 模块类型 1-智能问诊 2-健康检测 3-用药分析 4-知识问答 5-图像识别
	ModuleType param.Field[int64] `query:"module_type,required"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `query:"pet_profile_id,required"`
}

func (MedicalRecordOngoingRecordParams) URLQuery

func (r MedicalRecordOngoingRecordParams) URLQuery() (v url.Values)

URLQuery serializes MedicalRecordOngoingRecordParams's query parameters as `url.Values`.

type MedicalRecordService

type MedicalRecordService struct {
	Options []option.RequestOption
}

MedicalRecordService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMedicalRecordService method instead.

func NewMedicalRecordService

func NewMedicalRecordService(opts ...option.RequestOption) (r *MedicalRecordService)

NewMedicalRecordService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MedicalRecordService) Get

获取单个病例报告

func (*MedicalRecordService) NewList

获取医疗报告列表

func (*MedicalRecordService) OngoingRecord

获取进行中的医疗报告

func (*MedicalRecordService) Update

修改状态和记录对话进行阶段

type MedicalRecordUpdateParams

type MedicalRecordUpdateParams struct {
	IsRead param.Field[int64] `json:"is_read"`
	// 医疗报告 ID
	ReportID   param.Field[int64]     `json:"report_id"`
	ReportTime param.Field[time.Time] `json:"report_time" format:"date-time"`
	// 阶段存档
	Stage param.Field[string] `json:"stage"`
	// 1-进行中 2-已完成 3-手动结束 4-自动结束
	Status param.Field[int64] `json:"status"`
}

func (MedicalRecordUpdateParams) MarshalJSON

func (r MedicalRecordUpdateParams) MarshalJSON() (data []byte, err error)

type MedicationAnalysisPicResultParams

type MedicationAnalysisPicResultParams struct {
	// 图片归属(1:宠物体态分析、2:宠物表情分析、3:牙齿分析)
	ImgBelong param.Field[int64] `json:"img_belong"`
	// 图片 url
	ImgURL param.Field[string] `json:"img_url"`
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (MedicationAnalysisPicResultParams) MarshalJSON

func (r MedicationAnalysisPicResultParams) MarshalJSON() (data []byte, err error)

type MedicationAnalysisReportParams

type MedicationAnalysisReportParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (MedicationAnalysisReportParams) MarshalJSON

func (r MedicationAnalysisReportParams) MarshalJSON() (data []byte, err error)

type MedicationAnalysisService

type MedicationAnalysisService struct {
	Options []option.RequestOption
}

MedicationAnalysisService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMedicationAnalysisService method instead.

func NewMedicationAnalysisService

func NewMedicationAnalysisService(opts ...option.RequestOption) (r *MedicationAnalysisService)

NewMedicationAnalysisService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MedicationAnalysisService) PicResult

获取图片结果(流式)

func (*MedicationAnalysisService) Report

获取诊断报告

func (*MedicationAnalysisService) Summary

获取病情小结(流式)

type MedicationAnalysisSummaryParams

type MedicationAnalysisSummaryParams struct {
	// 宠物档案 id
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id"`
}

func (MedicationAnalysisSummaryParams) MarshalJSON

func (r MedicationAnalysisSummaryParams) MarshalJSON() (data []byte, err error)

type PetPetInfoGetParams

type PetPetInfoGetParams struct {
	// dog cat
	PetsType param.Field[PetPetInfoGetParamsPetsType] `query:"pets_type,required"`
	// 0-分组 1-不分组
	IsSort param.Field[PetPetInfoGetParamsIsSort] `query:"is_sort"`
}

func (PetPetInfoGetParams) URLQuery

func (r PetPetInfoGetParams) URLQuery() (v url.Values)

URLQuery serializes PetPetInfoGetParams's query parameters as `url.Values`.

type PetPetInfoGetParamsIsSort

type PetPetInfoGetParamsIsSort int64

0-分组 1-不分组

const (
	PetPetInfoGetParamsIsSort0 PetPetInfoGetParamsIsSort = 0
	PetPetInfoGetParamsIsSort1 PetPetInfoGetParamsIsSort = 1
)

func (PetPetInfoGetParamsIsSort) IsKnown

func (r PetPetInfoGetParamsIsSort) IsKnown() bool

type PetPetInfoGetParamsPetsType

type PetPetInfoGetParamsPetsType string

dog cat

const (
	PetPetInfoGetParamsPetsTypeDog PetPetInfoGetParamsPetsType = "dog"
	PetPetInfoGetParamsPetsTypeCat PetPetInfoGetParamsPetsType = "cat"
)

func (PetPetInfoGetParamsPetsType) IsKnown

func (r PetPetInfoGetParamsPetsType) IsKnown() bool

type PetPetInfoService

type PetPetInfoService struct {
	Options []option.RequestOption
}

PetPetInfoService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPetPetInfoService method instead.

func NewPetPetInfoService

func NewPetPetInfoService(opts ...option.RequestOption) (r *PetPetInfoService)

NewPetPetInfoService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PetPetInfoService) Get

宠物数据

type PetProfile

type PetProfile struct {
	ID int64 `json:"id"`
	// 过敏史
	AllergyHistory string `json:"allergy_history,nullable"`
	// 头像
	Avatar string `json:"avatar,nullable"`
	// 生日
	Birthday  string    `json:"birthday"`
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// 疾病史
	DiseaseHistory string `json:"disease_history,nullable"`
	// 家族史
	FamilyHistory string `json:"family_history,nullable"`
	// 性别 1-公 2-母
	Gender int64 `json:"gender"`
	// 是否已绝育 0-否 1-是
	IsNeutered int64 `json:"is_neutered,nullable"`
	// 是否已接种疫苗 0-否 1-是
	IsVaccination int64 `json:"is_vaccination"`
	// 宠物名字
	Name string `json:"name"`
	// 宠物类型
	PetType int64 `json:"pet_type"`
	// 宠物品种
	PetVariety string    `json:"pet_variety,nullable"`
	UpdatedAt  time.Time `json:"updated_at" format:"date-time"`
	// 疫苗时间
	VaccinationDate string `json:"vaccination_date,nullable"`
	// 重量
	Weight string         `json:"weight,nullable"`
	JSON   petProfileJSON `json:"-"`
}

func (*PetProfile) UnmarshalJSON

func (r *PetProfile) UnmarshalJSON(data []byte) (err error)

type PetProfileDeleteParams

type PetProfileDeleteParams struct {
	PetProfileID param.Field[int64] `query:"pet_profile_id,required"`
}

func (PetProfileDeleteParams) URLQuery

func (r PetProfileDeleteParams) URLQuery() (v url.Values)

URLQuery serializes PetProfileDeleteParams's query parameters as `url.Values`.

type PetProfileDeleteResponse

type PetProfileDeleteResponse struct {
	Data    string                       `json:"data"`
	Message string                       `json:"message"`
	Success bool                         `json:"success"`
	JSON    petProfileDeleteResponseJSON `json:"-"`
}

func (*PetProfileDeleteResponse) UnmarshalJSON

func (r *PetProfileDeleteResponse) UnmarshalJSON(data []byte) (err error)

type PetProfileExInfoParams

type PetProfileExInfoParams struct {
	PetProfileID param.Field[int64] `json:"pet_profile_id"`
}

func (PetProfileExInfoParams) MarshalJSON

func (r PetProfileExInfoParams) MarshalJSON() (data []byte, err error)

type PetProfileGetParams

type PetProfileGetParams struct {
	PetProfileID param.Field[int64] `query:"pet_profile_id,required"`
}

func (PetProfileGetParams) URLQuery

func (r PetProfileGetParams) URLQuery() (v url.Values)

URLQuery serializes PetProfileGetParams's query parameters as `url.Values`.

type PetProfileGetResponse

type PetProfileGetResponse struct {
	Data    PetProfile                `json:"data"`
	Message string                    `json:"message"`
	Success bool                      `json:"success"`
	JSON    petProfileGetResponseJSON `json:"-"`
}

func (*PetProfileGetResponse) UnmarshalJSON

func (r *PetProfileGetResponse) UnmarshalJSON(data []byte) (err error)

type PetProfileListResponse

type PetProfileListResponse struct {
	Data    []PetProfile               `json:"data"`
	Message string                     `json:"message"`
	Success bool                       `json:"success"`
	JSON    petProfileListResponseJSON `json:"-"`
}

func (*PetProfileListResponse) UnmarshalJSON

func (r *PetProfileListResponse) UnmarshalJSON(data []byte) (err error)

type PetProfileNewParams

type PetProfileNewParams struct {
	PetProfile PetProfileParam `json:"pet_profile,required"`
}

func (PetProfileNewParams) MarshalJSON

func (r PetProfileNewParams) MarshalJSON() (data []byte, err error)

type PetProfileParam

type PetProfileParam struct {
	// 过敏史
	AllergyHistory param.Field[string] `json:"allergy_history"`
	// 头像
	Avatar param.Field[string] `json:"avatar"`
	// 生日
	Birthday param.Field[string] `json:"birthday"`
	// 疾病史
	DiseaseHistory param.Field[string] `json:"disease_history"`
	// 家族史
	FamilyHistory param.Field[string] `json:"family_history"`
	// 性别 1-公 2-母
	Gender param.Field[int64] `json:"gender"`
	// 是否已绝育 0-否 1-是
	IsNeutered param.Field[int64] `json:"is_neutered"`
	// 是否已接种疫苗 0-否 1-是
	IsVaccination param.Field[int64] `json:"is_vaccination"`
	// 宠物名字
	Name param.Field[string] `json:"name"`
	// 宠物类型
	PetType param.Field[int64] `json:"pet_type"`
	// 宠物品种
	PetVariety param.Field[string] `json:"pet_variety"`
	// 疫苗时间
	VaccinationDate param.Field[string] `json:"vaccination_date"`
	// 重量
	Weight param.Field[string] `json:"weight"`
}

func (PetProfileParam) MarshalJSON

func (r PetProfileParam) MarshalJSON() (data []byte, err error)

type PetProfileService

type PetProfileService struct {
	Options []option.RequestOption
}

PetProfileService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPetProfileService method instead.

func NewPetProfileService

func NewPetProfileService(opts ...option.RequestOption) (r *PetProfileService)

NewPetProfileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PetProfileService) Delete

删除宠物档案

func (*PetProfileService) ExInfo

获取宠物档案扩展信息

func (*PetProfileService) Get

获取宠物档案

func (*PetProfileService) List

获取宠物档案列表

func (*PetProfileService) New

创建宠物档案

func (*PetProfileService) Update

func (r *PetProfileService) Update(ctx context.Context, params PetProfileUpdateParams, opts ...option.RequestOption) (err error)

更新宠物档案

func (*PetProfileService) Variety

func (r *PetProfileService) Variety(ctx context.Context, body PetProfileVarietyParams, opts ...option.RequestOption) (res *string, err error)

获取宠物品种

type PetProfileUpdateParams

type PetProfileUpdateParams struct {
	PetProfileID param.Field[int64] `query:"pet_profile_id,required"`
	PetProfile   PetProfileParam    `json:"pet_profile,required"`
}

func (PetProfileUpdateParams) MarshalJSON

func (r PetProfileUpdateParams) MarshalJSON() (data []byte, err error)

func (PetProfileUpdateParams) URLQuery

func (r PetProfileUpdateParams) URLQuery() (v url.Values)

URLQuery serializes PetProfileUpdateParams's query parameters as `url.Values`.

type PetProfileVarietyParams

type PetProfileVarietyParams struct {
	UserInput param.Field[string] `json:"user_input"`
}

func (PetProfileVarietyParams) MarshalJSON

func (r PetProfileVarietyParams) MarshalJSON() (data []byte, err error)

type PetService

type PetService struct {
	Options []option.RequestOption
	PetInfo *PetPetInfoService
}

PetService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPetService method instead.

func NewPetService

func NewPetService(opts ...option.RequestOption) (r *PetService)

NewPetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type PointDetailGetParams

type PointDetailGetParams struct {
	// 0-支出 1-收入 2-全部
	IsAdd param.Field[PointDetailGetParamsIsAdd] `query:"is_add"`
	// 每页数量
	Limit param.Field[int64] `query:"limit"`
	// 页数
	Page param.Field[int64] `query:"page"`
}

func (PointDetailGetParams) URLQuery

func (r PointDetailGetParams) URLQuery() (v url.Values)

URLQuery serializes PointDetailGetParams's query parameters as `url.Values`.

type PointDetailGetParamsIsAdd

type PointDetailGetParamsIsAdd int64

0-支出 1-收入 2-全部

const (
	PointDetailGetParamsIsAdd0 PointDetailGetParamsIsAdd = 0
	PointDetailGetParamsIsAdd1 PointDetailGetParamsIsAdd = 1
	PointDetailGetParamsIsAdd2 PointDetailGetParamsIsAdd = 2
)

func (PointDetailGetParamsIsAdd) IsKnown

func (r PointDetailGetParamsIsAdd) IsKnown() bool

type PointDetailGetResponse

type PointDetailGetResponse struct {
	Data []PointDetailGetResponseData `json:"data"`
	JSON pointDetailGetResponseJSON   `json:"-"`
}

func (*PointDetailGetResponse) UnmarshalJSON

func (r *PointDetailGetResponse) UnmarshalJSON(data []byte) (err error)

type PointDetailGetResponseData

type PointDetailGetResponseData struct {
	// id
	ID int64 `json:"id"`
	// 明细说明
	Description string `json:"description"`
	// 明细类型 1-购买增加积分 2-活动增加积分 3-模块核销积分
	DetailType int64 `json:"detail_type"`
	// 0-减少 1-增加
	IsAdd PointDetailGetResponseDataIsAdd `json:"is_add"`
	// 0-非购买积分 1-购买积分
	IsPurchasePoint int64 `json:"is_purchase_point"`
	// 积分数量
	PointNum string `json:"point_num"`
	// 会话 id
	SessionID string `json:"session_id"`
	// 用户 uuid
	UserUuid string                         `json:"user_uuid"`
	JSON     pointDetailGetResponseDataJSON `json:"-"`
}

func (*PointDetailGetResponseData) UnmarshalJSON

func (r *PointDetailGetResponseData) UnmarshalJSON(data []byte) (err error)

type PointDetailGetResponseDataIsAdd

type PointDetailGetResponseDataIsAdd int64

0-减少 1-增加

const (
	PointDetailGetResponseDataIsAdd0 PointDetailGetResponseDataIsAdd = 0
	PointDetailGetResponseDataIsAdd1 PointDetailGetResponseDataIsAdd = 1
)

func (PointDetailGetResponseDataIsAdd) IsKnown

type PointDetailService

type PointDetailService struct {
	Options []option.RequestOption
}

PointDetailService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPointDetailService method instead.

func NewPointDetailService

func NewPointDetailService(opts ...option.RequestOption) (r *PointDetailService)

NewPointDetailService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PointDetailService) Get

获取积分明细

type PointPriceGetResponse

type PointPriceGetResponse struct {
	Data PointPriceGetResponseData `json:"data"`
	JSON pointPriceGetResponseJSON `json:"-"`
}

func (*PointPriceGetResponse) UnmarshalJSON

func (r *PointPriceGetResponse) UnmarshalJSON(data []byte) (err error)

type PointPriceGetResponseData

type PointPriceGetResponseData struct {
	// 是否为模块项目
	IsModuleItem int64 `json:"is_module_item"`
	// 积分类型
	ItemKey string `json:"item_key"`
	// 项目名
	ItemName string `json:"item_name"`
	// 项目 key 名
	Price string `json:"price"`
	// 关联模块
	RelatedModule string                        `json:"related_module"`
	JSON          pointPriceGetResponseDataJSON `json:"-"`
}

func (*PointPriceGetResponseData) UnmarshalJSON

func (r *PointPriceGetResponseData) UnmarshalJSON(data []byte) (err error)

type PointPriceService

type PointPriceService struct {
	Options []option.RequestOption
}

PointPriceService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPointPriceService method instead.

func NewPointPriceService

func NewPointPriceService(opts ...option.RequestOption) (r *PointPriceService)

NewPointPriceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PointPriceService) Get

获取积分价格

type PointTaskBonusParams

type PointTaskBonusParams struct {
	// 任务 id
	TaskID param.Field[int64] `json:"task_id"`
}

func (PointTaskBonusParams) MarshalJSON

func (r PointTaskBonusParams) MarshalJSON() (data []byte, err error)

type PointTaskConfirmParams

type PointTaskConfirmParams struct {
	// 任务 id
	TaskID param.Field[int64] `json:"task_id"`
}

func (PointTaskConfirmParams) MarshalJSON

func (r PointTaskConfirmParams) MarshalJSON() (data []byte, err error)

type PointTaskListResponse

type PointTaskListResponse struct {
	Data []PointTaskListResponseData `json:"data"`
	// message
	Message string `json:"message"`
	// success
	Success bool                      `json:"success"`
	JSON    pointTaskListResponseJSON `json:"-"`
}

func (*PointTaskListResponse) UnmarshalJSON

func (r *PointTaskListResponse) UnmarshalJSON(data []byte) (err error)

type PointTaskListResponseData

type PointTaskListResponseData struct {
	// id
	ID int64 `json:"id"`
	// 可完成次数
	AchieveCount int64 `json:"achieve_count"`
	// 积分奖励
	BonusPoint string `json:"bonus_point"`
	// 完成条件次数
	ConditionCount int64 `json:"condition_count"`
	// 任务说明
	Description string `json:"description"`
	// 任务图标
	Icon string `json:"icon"`
	// 0-未开启 1-开启
	IsOpen int64 `json:"is_open"`
	// 关联模块
	RelatedModule string `json:"related_module"`
	// 1-未完成 2-未领取
	Status int64 `json:"status"`
	// 任务动作
	TaskAction string `json:"task_action"`
	// 任务名称
	TaskName string `json:"task_name"`
	// 跳转页面
	ToPage string                        `json:"to_page"`
	JSON   pointTaskListResponseDataJSON `json:"-"`
}

func (*PointTaskListResponseData) UnmarshalJSON

func (r *PointTaskListResponseData) UnmarshalJSON(data []byte) (err error)

type PointTaskService

type PointTaskService struct {
	Options []option.RequestOption
}

PointTaskService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPointTaskService method instead.

func NewPointTaskService

func NewPointTaskService(opts ...option.RequestOption) (r *PointTaskService)

NewPointTaskService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PointTaskService) Bonus

func (r *PointTaskService) Bonus(ctx context.Context, body PointTaskBonusParams, opts ...option.RequestOption) (err error)

领取奖励

func (*PointTaskService) Confirm

func (r *PointTaskService) Confirm(ctx context.Context, body PointTaskConfirmParams, opts ...option.RequestOption) (err error)

确认积分任务

func (*PointTaskService) List

获取积分任务列表

type PolicyPolicyInfoParams

type PolicyPolicyInfoParams struct {
	// 密钥
	Keys param.Field[string] `json:"keys"`
	// 1-用户协议 2-免责条款 3-隐私政策
	PolicyType param.Field[int64] `json:"policy_type"`
}

func (PolicyPolicyInfoParams) MarshalJSON

func (r PolicyPolicyInfoParams) MarshalJSON() (data []byte, err error)

type PolicyService

type PolicyService struct {
	Options []option.RequestOption
}

PolicyService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPolicyService method instead.

func NewPolicyService

func NewPolicyService(opts ...option.RequestOption) (r *PolicyService)

NewPolicyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PolicyService) PolicyInfo

func (r *PolicyService) PolicyInfo(ctx context.Context, body PolicyPolicyInfoParams, opts ...option.RequestOption) (err error)

政策类型

type SessionRecordHistoryParams

type SessionRecordHistoryParams struct {
	// 内容
	Content param.Field[string] `json:"content,required"`
	// 1-智能问诊 2-健康检测 3-用药分析 4-知识问答 5-图像识别
	ModuleType param.Field[int64] `json:"module_type,required"`
	// 角色, 取值为其中之一 ==>[user, ai]
	Role param.Field[string] `json:"role,required"`
	// 会话 id
	SessionID param.Field[string] `json:"session_id,required"`
	// 1-文字 2-图文
	ContentType param.Field[int64] `json:"content_type"`
	// 1-用户主诉 2-用户回答 3-AI 提问 4-AI 病情小结 5-AI 病例报告 6-AI 输出 7-用户补充
	Stage param.Field[int64] `json:"stage"`
}

func (SessionRecordHistoryParams) MarshalJSON

func (r SessionRecordHistoryParams) MarshalJSON() (data []byte, err error)

type SessionRecordService

type SessionRecordService struct {
	Options []option.RequestOption
}

SessionRecordService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSessionRecordService method instead.

func NewSessionRecordService

func NewSessionRecordService(opts ...option.RequestOption) (r *SessionRecordService)

NewSessionRecordService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SessionRecordService) History

保存聊天记录

type UploadImageNewParams

type UploadImageNewParams struct {
	// 要上传的图片文件
	Image param.Field[io.Reader] `json:"image,required" format:"binary"`
	// 是否上传到图床
	IsToCloud param.Field[int64] `query:"is_to_cloud"`
	// 图片上传类型 1-头像 2-图片识别模块 3-表情包 4-其他
	UploadType param.Field[UploadImageNewParamsUploadType] `query:"upload_type"`
}

func (UploadImageNewParams) MarshalMultipart

func (r UploadImageNewParams) MarshalMultipart() (data []byte, contentType string, err error)

func (UploadImageNewParams) URLQuery

func (r UploadImageNewParams) URLQuery() (v url.Values)

URLQuery serializes UploadImageNewParams's query parameters as `url.Values`.

type UploadImageNewParamsUploadType

type UploadImageNewParamsUploadType int64

图片上传类型 1-头像 2-图片识别模块 3-表情包 4-其他

const (
	UploadImageNewParamsUploadType1 UploadImageNewParamsUploadType = 1
	UploadImageNewParamsUploadType2 UploadImageNewParamsUploadType = 2
	UploadImageNewParamsUploadType3 UploadImageNewParamsUploadType = 3
	UploadImageNewParamsUploadType4 UploadImageNewParamsUploadType = 4
)

func (UploadImageNewParamsUploadType) IsKnown

type UploadImageOssNewParams

type UploadImageOssNewParams struct {
	// 图片上传类型 1-头像 2-图片识别模块 3-表情包 4-其他
	UploadType param.Field[UploadImageOssNewParamsUploadType] `query:"upload_type,required"`
	// 要上传的图片文件
	Image param.Field[io.Reader] `json:"image,required" format:"binary"`
	// 是否上传到本地服务器
	UploadToLocal param.Field[int64] `query:"upload_to_local"`
}

func (UploadImageOssNewParams) MarshalMultipart

func (r UploadImageOssNewParams) MarshalMultipart() (data []byte, contentType string, err error)

func (UploadImageOssNewParams) URLQuery

func (r UploadImageOssNewParams) URLQuery() (v url.Values)

URLQuery serializes UploadImageOssNewParams's query parameters as `url.Values`.

type UploadImageOssNewParamsUploadType

type UploadImageOssNewParamsUploadType int64

图片上传类型 1-头像 2-图片识别模块 3-表情包 4-其他

const (
	UploadImageOssNewParamsUploadType1 UploadImageOssNewParamsUploadType = 1
	UploadImageOssNewParamsUploadType2 UploadImageOssNewParamsUploadType = 2
	UploadImageOssNewParamsUploadType3 UploadImageOssNewParamsUploadType = 3
	UploadImageOssNewParamsUploadType4 UploadImageOssNewParamsUploadType = 4
)

func (UploadImageOssNewParamsUploadType) IsKnown

type UploadImageOssService

type UploadImageOssService struct {
	Options []option.RequestOption
}

UploadImageOssService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUploadImageOssService method instead.

func NewUploadImageOssService

func NewUploadImageOssService(opts ...option.RequestOption) (r *UploadImageOssService)

NewUploadImageOssService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UploadImageOssService) New

允许用户上传一张图片

type UploadImageService

type UploadImageService struct {
	Options []option.RequestOption
}

UploadImageService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUploadImageService method instead.

func NewUploadImageService

func NewUploadImageService(opts ...option.RequestOption) (r *UploadImageService)

NewUploadImageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UploadImageService) New

允许用户上传一张图片

type UploadNewParams

type UploadNewParams struct {
	// 要上传的图片文件
	Image param.Field[io.Reader] `json:"image,required" format:"binary"`
	// 是否上传到图床
	IsToCloud param.Field[int64] `query:"is_to_cloud"`
}

func (UploadNewParams) MarshalMultipart

func (r UploadNewParams) MarshalMultipart() (data []byte, contentType string, err error)

func (UploadNewParams) URLQuery

func (r UploadNewParams) URLQuery() (v url.Values)

URLQuery serializes UploadNewParams's query parameters as `url.Values`.

type UploadService

type UploadService struct {
	Options []option.RequestOption
}

UploadService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUploadService method instead.

func NewUploadService

func NewUploadService(opts ...option.RequestOption) (r *UploadService)

NewUploadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UploadService) New

func (r *UploadService) New(ctx context.Context, params UploadNewParams, opts ...option.RequestOption) (err error)

允许用户上传一张图片

type UserAdviceNewParams

type UserAdviceNewParams struct {
	// 反馈类型
	AdviceType param.Field[string] `json:"advice_type,required"`
	// 反馈内容
	Description param.Field[string]   `json:"description,required"`
	ImageList   param.Field[[]string] `json:"image_list,required"`
}

func (UserAdviceNewParams) MarshalJSON

func (r UserAdviceNewParams) MarshalJSON() (data []byte, err error)

type UserAdviceService

type UserAdviceService struct {
	Options []option.RequestOption
}

UserAdviceService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserAdviceService method instead.

func NewUserAdviceService

func NewUserAdviceService(opts ...option.RequestOption) (r *UserAdviceService)

NewUserAdviceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserAdviceService) New

用户反馈

type UserAsrNewParams

type UserAsrNewParams struct {
	Length param.Field[int64]  `json:"length"`
	Speech param.Field[string] `json:"speech"`
}

func (UserAsrNewParams) MarshalJSON

func (r UserAsrNewParams) MarshalJSON() (data []byte, err error)

type UserAsrService

type UserAsrService struct {
	Options []option.RequestOption
}

UserAsrService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserAsrService method instead.

func NewUserAsrService

func NewUserAsrService(opts ...option.RequestOption) (r *UserAsrService)

NewUserAsrService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserAsrService) New

func (r *UserAsrService) New(ctx context.Context, body UserAsrNewParams, opts ...option.RequestOption) (err error)

语音识别

type UserChatVParams

type UserChatVParams struct {
	Content   param.Field[string] `json:"content"`
	SessionID param.Field[string] `json:"session_id"`
}

func (UserChatVParams) MarshalJSON

func (r UserChatVParams) MarshalJSON() (data []byte, err error)

type UserContactNewParams

type UserContactNewParams struct {
	CompanyName param.Field[string] `json:"company_name"`
	ContactName param.Field[string] `json:"contact_name"`
	Mobile      param.Field[string] `json:"mobile"`
}

func (UserContactNewParams) MarshalJSON

func (r UserContactNewParams) MarshalJSON() (data []byte, err error)

type UserContactService

type UserContactService struct {
	Options []option.RequestOption
}

UserContactService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserContactService method instead.

func NewUserContactService

func NewUserContactService(opts ...option.RequestOption) (r *UserContactService)

NewUserContactService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserContactService) New

合作交流信息保存

type UserIndustryService

type UserIndustryService struct {
	Options []option.RequestOption
}

UserIndustryService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserIndustryService method instead.

func NewUserIndustryService

func NewUserIndustryService(opts ...option.RequestOption) (r *UserIndustryService)

NewUserIndustryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserIndustryService) Get

func (r *UserIndustryService) Get(ctx context.Context, opts ...option.RequestOption) (err error)

行业列表

type UserModuleUsageGetAddWecomeBonusParams

type UserModuleUsageGetAddWecomeBonusParams struct {
	// 1-智能问诊 2-健康检测 3-用药分析 4-知识问答 5-图像识别
	ModuleType param.Field[int64] `json:"module_type"`
}

func (UserModuleUsageGetAddWecomeBonusParams) MarshalJSON

func (r UserModuleUsageGetAddWecomeBonusParams) MarshalJSON() (data []byte, err error)

type UserModuleUsageGetAddWecomeBonusResponse

type UserModuleUsageGetAddWecomeBonusResponse struct {
	Data    UserModuleUsageGetAddWecomeBonusResponseData `json:"data"`
	Message string                                       `json:"message"`
	Success bool                                         `json:"success"`
	JSON    userModuleUsageGetAddWecomeBonusResponseJSON `json:"-"`
}

func (*UserModuleUsageGetAddWecomeBonusResponse) UnmarshalJSON

func (r *UserModuleUsageGetAddWecomeBonusResponse) UnmarshalJSON(data []byte) (err error)

type UserModuleUsageGetAddWecomeBonusResponseData

type UserModuleUsageGetAddWecomeBonusResponseData struct {
	IsAddWecome int64                                            `json:"is_add_wecome"`
	JSON        userModuleUsageGetAddWecomeBonusResponseDataJSON `json:"-"`
}

func (*UserModuleUsageGetAddWecomeBonusResponseData) UnmarshalJSON

func (r *UserModuleUsageGetAddWecomeBonusResponseData) UnmarshalJSON(data []byte) (err error)

type UserModuleUsageGetWechatMiniQrcodeResponse

type UserModuleUsageGetWechatMiniQrcodeResponse struct {
	Data    UserModuleUsageGetWechatMiniQrcodeResponseData `json:"data"`
	Message string                                         `json:"message"`
	Success bool                                           `json:"success"`
	JSON    userModuleUsageGetWechatMiniQrcodeResponseJSON `json:"-"`
}

func (*UserModuleUsageGetWechatMiniQrcodeResponse) UnmarshalJSON

func (r *UserModuleUsageGetWechatMiniQrcodeResponse) UnmarshalJSON(data []byte) (err error)

type UserModuleUsageGetWechatMiniQrcodeResponseData

type UserModuleUsageGetWechatMiniQrcodeResponseData struct {
	CodeURL string                                             `json:"code_url"`
	JSON    userModuleUsageGetWechatMiniQrcodeResponseDataJSON `json:"-"`
}

func (*UserModuleUsageGetWechatMiniQrcodeResponseData) UnmarshalJSON

func (r *UserModuleUsageGetWechatMiniQrcodeResponseData) UnmarshalJSON(data []byte) (err error)

type UserModuleUsageIsAddWecomeGetResponse

type UserModuleUsageIsAddWecomeGetResponse struct {
	Data    UserModuleUsageIsAddWecomeGetResponseData `json:"data"`
	Message string                                    `json:"message"`
	Success bool                                      `json:"success"`
	JSON    userModuleUsageIsAddWecomeGetResponseJSON `json:"-"`
}

func (*UserModuleUsageIsAddWecomeGetResponse) UnmarshalJSON

func (r *UserModuleUsageIsAddWecomeGetResponse) UnmarshalJSON(data []byte) (err error)

type UserModuleUsageIsAddWecomeGetResponseData

type UserModuleUsageIsAddWecomeGetResponseData struct {
	IsAddWecome int64                                         `json:"is_add_wecome"`
	JSON        userModuleUsageIsAddWecomeGetResponseDataJSON `json:"-"`
}

func (*UserModuleUsageIsAddWecomeGetResponseData) UnmarshalJSON

func (r *UserModuleUsageIsAddWecomeGetResponseData) UnmarshalJSON(data []byte) (err error)

type UserModuleUsageIsAddWecomeService

type UserModuleUsageIsAddWecomeService struct {
	Options []option.RequestOption
}

UserModuleUsageIsAddWecomeService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserModuleUsageIsAddWecomeService method instead.

func NewUserModuleUsageIsAddWecomeService

func NewUserModuleUsageIsAddWecomeService(opts ...option.RequestOption) (r *UserModuleUsageIsAddWecomeService)

NewUserModuleUsageIsAddWecomeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserModuleUsageIsAddWecomeService) Get

是否领取过添加企微的奖励

type UserModuleUsageService

type UserModuleUsageService struct {
	Options     []option.RequestOption
	IsAddWecome *UserModuleUsageIsAddWecomeService
}

UserModuleUsageService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserModuleUsageService method instead.

func NewUserModuleUsageService

func NewUserModuleUsageService(opts ...option.RequestOption) (r *UserModuleUsageService)

NewUserModuleUsageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserModuleUsageService) Checkin

func (r *UserModuleUsageService) Checkin(ctx context.Context, opts ...option.RequestOption) (err error)

签到

func (*UserModuleUsageService) GetAddWecomeBonus

领取添加企微的奖励

func (*UserModuleUsageService) GetWechatMiniQrcode

获取微信小程序二维码

type UserPointCostReportParams

type UserPointCostReportParams struct {
	ItemKey param.Field[string] `json:"item_key"`
	// 病历 id
	MedicalRecordID param.Field[int64] `json:"medical_record_id"`
}

func (UserPointCostReportParams) MarshalJSON

func (r UserPointCostReportParams) MarshalJSON() (data []byte, err error)

type UserPointGetResponse

type UserPointGetResponse struct {
	Data UserPointGetResponseData `json:"data"`
	JSON userPointGetResponseJSON `json:"-"`
}

func (*UserPointGetResponse) UnmarshalJSON

func (r *UserPointGetResponse) UnmarshalJSON(data []byte) (err error)

type UserPointGetResponseData

type UserPointGetResponseData struct {
	// 赠送的积分余额
	BonusPoint string `json:"bonus_point"`
	// 购买的积分余额
	PurchasePoint string `json:"purchase_point"`
	// 总积分余额
	TotalPoint string                       `json:"total_point"`
	JSON       userPointGetResponseDataJSON `json:"-"`
}

func (*UserPointGetResponseData) UnmarshalJSON

func (r *UserPointGetResponseData) UnmarshalJSON(data []byte) (err error)

type UserPointService

type UserPointService struct {
	Options []option.RequestOption
}

UserPointService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserPointService method instead.

func NewUserPointService

func NewUserPointService(opts ...option.RequestOption) (r *UserPointService)

NewUserPointService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserPointService) CostReport

func (r *UserPointService) CostReport(ctx context.Context, body UserPointCostReportParams, opts ...option.RequestOption) (err error)

积分消耗报表

func (*UserPointService) Get

获取用户积分

type UserSendSMSParams

type UserSendSMSParams struct {
	Phone param.Field[string] `json:"phone"`
}

func (UserSendSMSParams) MarshalJSON

func (r UserSendSMSParams) MarshalJSON() (data []byte, err error)

type UserService

type UserService struct {
	Options  []option.RequestOption
	UserInfo *UserUserInfoService
	Contact  *UserContactService
	Summary  *UserSummaryService
	Asr      *UserAsrService
	Industry *UserIndustryService
}

UserService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserService method instead.

func NewUserService

func NewUserService(opts ...option.RequestOption) (r *UserService)

NewUserService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserService) ChatV

func (r *UserService) ChatV(ctx context.Context, body UserChatVParams, opts ...option.RequestOption) (err error)

AI 图片聊天

func (*UserService) Logout

func (r *UserService) Logout(ctx context.Context, opts ...option.RequestOption) (err error)

Logs out the user

func (*UserService) SendSMS

func (r *UserService) SendSMS(ctx context.Context, body UserSendSMSParams, opts ...option.RequestOption) (err error)

发验证短信

type UserSummaryNewParams

type UserSummaryNewParams struct {
	SessionID param.Field[string] `json:"session_id"`
}

func (UserSummaryNewParams) MarshalJSON

func (r UserSummaryNewParams) MarshalJSON() (data []byte, err error)

type UserSummaryService

type UserSummaryService struct {
	Options []option.RequestOption
}

UserSummaryService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserSummaryService method instead.

func NewUserSummaryService

func NewUserSummaryService(opts ...option.RequestOption) (r *UserSummaryService)

NewUserSummaryService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserSummaryService) New

合作交流信息保存

type UserUserInfoGetParams

type UserUserInfoGetParams struct {
	// 用户 UUID
	Uuid param.Field[string] `query:"uuid,required"`
}

func (UserUserInfoGetParams) URLQuery

func (r UserUserInfoGetParams) URLQuery() (v url.Values)

URLQuery serializes UserUserInfoGetParams's query parameters as `url.Values`.

type UserUserInfoService

type UserUserInfoService struct {
	Options []option.RequestOption
}

UserUserInfoService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUserUserInfoService method instead.

func NewUserUserInfoService

func NewUserUserInfoService(opts ...option.RequestOption) (r *UserUserInfoService)

NewUserUserInfoService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UserUserInfoService) Get

获取用户信息

type WhitelistFilteringDataParams

type WhitelistFilteringDataParams struct {
	// 过滤数据
	FilteringData param.Field[string] `json:"filtering_data"`
}

func (WhitelistFilteringDataParams) MarshalJSON

func (r WhitelistFilteringDataParams) MarshalJSON() (data []byte, err error)

type WhitelistSaveDataParams

type WhitelistSaveDataParams struct {
	// 保存数据
	SaveData param.Field[[]string] `json:"save_data"`
}

func (WhitelistSaveDataParams) MarshalJSON

func (r WhitelistSaveDataParams) MarshalJSON() (data []byte, err error)

type WhitelistService

type WhitelistService struct {
	Options []option.RequestOption
}

WhitelistService contains methods and other services that help with interacting with the czlai API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWhitelistService method instead.

func NewWhitelistService

func NewWhitelistService(opts ...option.RequestOption) (r *WhitelistService)

NewWhitelistService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*WhitelistService) FilteringData

func (r *WhitelistService) FilteringData(ctx context.Context, body WhitelistFilteringDataParams, opts ...option.RequestOption) (err error)

白名单数据过滤

func (*WhitelistService) SaveData

func (r *WhitelistService) SaveData(ctx context.Context, body WhitelistSaveDataParams, opts ...option.RequestOption) (err error)

白名单数据保存

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL