From b4a32593cc9bfb3587381e28c95bb19f942c4d4f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 10 Feb 2024 09:52:14 +0000 Subject: [PATCH] skip ci --- .../inference/common/GoUnusedProtection__.go | 7 + .../common/com.inference.common-consts.go | 24 + .../inference/common/com.inference.common.go | 576 ++++++ .../inference/rest/GoUnusedProtection__.go | 7 + .../rest/com.inference.rest-consts.go | 27 + .../com/inference/rest/com.inference.rest.go | 874 +++++++++ .../com/inference/ws/GoUnusedProtection__.go | 7 + .../inference/ws/com.inference.ws-consts.go | 27 + .../com/inference/ws/com.inference.ws.go | 1674 +++++++++++++++++ .../html/com.inference.common.html | 32 + types/llm-inference/html/com.inference.html | 15 + .../html/com.inference.rest.html | 44 + .../llm-inference/html/com.inference.ws.html | 72 + types/llm-inference/html/index.html | 42 + types/llm-inference/html/style.css | 184 ++ types/llm-inference/python/__init__.py | 0 types/llm-inference/python/com/__init__.py | 0 .../python/com/inference/__init__.py | 0 .../python/com/inference/common/__init__.py | 1 + .../python/com/inference/common/constants.py | 14 + .../python/com/inference/common/ttypes.py | 240 +++ .../python/com/inference/rest/__init__.py | 1 + .../python/com/inference/rest/constants.py | 14 + .../python/com/inference/rest/ttypes.py | 447 +++++ .../python/com/inference/ws/__init__.py | 1 + .../python/com/inference/ws/constants.py | 14 + .../python/com/inference/ws/ttypes.py | 863 +++++++++ .../thrift/com.inference.common.thrift | 18 + .../thrift/com.inference.rest.thrift | 31 + .../llm-inference/thrift/com.inference.thrift | 5 + .../thrift/com.inference.ws.thrift | 59 + .../com.inference.common_types.d.ts | 27 + .../typescript/com.inference.common_types.js | 234 +++ .../typescript/com.inference.rest_types.d.ts | 45 + .../typescript/com.inference.rest_types.js | 415 ++++ .../typescript/com.inference.ws_types.d.ts | 83 + .../typescript/com.inference.ws_types.js | 788 ++++++++ .../com/milvus/nats/GoUnusedProtection__.go | 7 + .../com/milvus/nats/com.milvus.nats-consts.go | 24 + .../golang/com/milvus/nats/com.milvus.nats.go | 1517 +++++++++++++++ .../html/com.milvus.nats.html | 65 + types/milvus-adapter-service/html/index.html | 20 + types/milvus-adapter-service/html/style.css | 184 ++ .../milvus-adapter-service/python/__init__.py | 0 .../python/com/__init__.py | 0 .../python/com/milvus/__init__.py | 0 .../python/com/milvus/nats/__init__.py | 1 + .../python/com/milvus/nats/constants.py | 14 + .../python/com/milvus/nats/ttypes.py | 723 +++++++ .../thrift/com.milvus.nats.thrift | 50 + .../typescript/com.milvus.nats_types.d.ts | 70 + .../typescript/com.milvus.nats_types.js | 706 +++++++ 52 files changed, 10293 insertions(+) create mode 100644 types/llm-inference/golang/com/inference/common/GoUnusedProtection__.go create mode 100644 types/llm-inference/golang/com/inference/common/com.inference.common-consts.go create mode 100644 types/llm-inference/golang/com/inference/common/com.inference.common.go create mode 100644 types/llm-inference/golang/com/inference/rest/GoUnusedProtection__.go create mode 100644 types/llm-inference/golang/com/inference/rest/com.inference.rest-consts.go create mode 100644 types/llm-inference/golang/com/inference/rest/com.inference.rest.go create mode 100644 types/llm-inference/golang/com/inference/ws/GoUnusedProtection__.go create mode 100644 types/llm-inference/golang/com/inference/ws/com.inference.ws-consts.go create mode 100644 types/llm-inference/golang/com/inference/ws/com.inference.ws.go create mode 100644 types/llm-inference/html/com.inference.common.html create mode 100644 types/llm-inference/html/com.inference.html create mode 100644 types/llm-inference/html/com.inference.rest.html create mode 100644 types/llm-inference/html/com.inference.ws.html create mode 100644 types/llm-inference/html/index.html create mode 100644 types/llm-inference/html/style.css create mode 100644 types/llm-inference/python/__init__.py create mode 100644 types/llm-inference/python/com/__init__.py create mode 100644 types/llm-inference/python/com/inference/__init__.py create mode 100644 types/llm-inference/python/com/inference/common/__init__.py create mode 100644 types/llm-inference/python/com/inference/common/constants.py create mode 100644 types/llm-inference/python/com/inference/common/ttypes.py create mode 100644 types/llm-inference/python/com/inference/rest/__init__.py create mode 100644 types/llm-inference/python/com/inference/rest/constants.py create mode 100644 types/llm-inference/python/com/inference/rest/ttypes.py create mode 100644 types/llm-inference/python/com/inference/ws/__init__.py create mode 100644 types/llm-inference/python/com/inference/ws/constants.py create mode 100644 types/llm-inference/python/com/inference/ws/ttypes.py create mode 100644 types/llm-inference/thrift/com.inference.common.thrift create mode 100644 types/llm-inference/thrift/com.inference.rest.thrift create mode 100644 types/llm-inference/thrift/com.inference.thrift create mode 100644 types/llm-inference/thrift/com.inference.ws.thrift create mode 100644 types/llm-inference/typescript/com.inference.common_types.d.ts create mode 100644 types/llm-inference/typescript/com.inference.common_types.js create mode 100644 types/llm-inference/typescript/com.inference.rest_types.d.ts create mode 100644 types/llm-inference/typescript/com.inference.rest_types.js create mode 100644 types/llm-inference/typescript/com.inference.ws_types.d.ts create mode 100644 types/llm-inference/typescript/com.inference.ws_types.js create mode 100644 types/milvus-adapter-service/golang/com/milvus/nats/GoUnusedProtection__.go create mode 100644 types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats-consts.go create mode 100644 types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats.go create mode 100644 types/milvus-adapter-service/html/com.milvus.nats.html create mode 100644 types/milvus-adapter-service/html/index.html create mode 100644 types/milvus-adapter-service/html/style.css create mode 100644 types/milvus-adapter-service/python/__init__.py create mode 100644 types/milvus-adapter-service/python/com/__init__.py create mode 100644 types/milvus-adapter-service/python/com/milvus/__init__.py create mode 100644 types/milvus-adapter-service/python/com/milvus/nats/__init__.py create mode 100644 types/milvus-adapter-service/python/com/milvus/nats/constants.py create mode 100644 types/milvus-adapter-service/python/com/milvus/nats/ttypes.py create mode 100644 types/milvus-adapter-service/thrift/com.milvus.nats.thrift create mode 100644 types/milvus-adapter-service/typescript/com.milvus.nats_types.d.ts create mode 100644 types/milvus-adapter-service/typescript/com.milvus.nats_types.js diff --git a/types/llm-inference/golang/com/inference/common/GoUnusedProtection__.go b/types/llm-inference/golang/com/inference/common/GoUnusedProtection__.go new file mode 100644 index 0000000..af73e04 --- /dev/null +++ b/types/llm-inference/golang/com/inference/common/GoUnusedProtection__.go @@ -0,0 +1,7 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package common + +var GoUnusedProtection__ int; + diff --git a/types/llm-inference/golang/com/inference/common/com.inference.common-consts.go b/types/llm-inference/golang/com/inference/common/com.inference.common-consts.go new file mode 100644 index 0000000..d9ced1b --- /dev/null +++ b/types/llm-inference/golang/com/inference/common/com.inference.common-consts.go @@ -0,0 +1,24 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package common + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + + +func init() { +} + diff --git a/types/llm-inference/golang/com/inference/common/com.inference.common.go b/types/llm-inference/golang/com/inference/common/com.inference.common.go new file mode 100644 index 0000000..07eb3e5 --- /dev/null +++ b/types/llm-inference/golang/com/inference/common/com.inference.common.go @@ -0,0 +1,576 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package common + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +// Attributes: +// - RequestID +// - Prompt +type SinglePrompt struct { + RequestID string `thrift:"request_id,1,required" db:"request_id" json:"request_id"` + Prompt *string `thrift:"prompt,2" db:"prompt" json:"prompt,omitempty"` +} + +func NewSinglePrompt() *SinglePrompt { + return &SinglePrompt{} +} + + +func (p *SinglePrompt) GetRequestID() string { + return p.RequestID +} +var SinglePrompt_Prompt_DEFAULT string +func (p *SinglePrompt) GetPrompt() string { + if !p.IsSetPrompt() { + return SinglePrompt_Prompt_DEFAULT + } +return *p.Prompt +} +func (p *SinglePrompt) IsSetPrompt() bool { + return p.Prompt != nil +} + +func (p *SinglePrompt) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetRequestID bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + issetRequestID = true + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRequestID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RequestID is not set")); + } + return nil +} + +func (p *SinglePrompt) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *SinglePrompt) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prompt = &v +} + return nil +} + +func (p *SinglePrompt) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("SinglePrompt"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SinglePrompt) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *SinglePrompt) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPrompt() { + if err := oprot.WriteFieldBegin("prompt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prompt: ", p), err) } + if err := oprot.WriteString(string(*p.Prompt)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prompt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prompt: ", p), err) } + } + return err +} + +func (p *SinglePrompt) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SinglePrompt(%+v)", *p) +} + +// Attributes: +// - NumBeams +// - DoSample +// - Temperature +// - TopP +// - TopK +// - MaxNewTokens +// - RepetitionPenalty +// - LengthPenalty +type GenerationConfig struct { + NumBeams *int32 `thrift:"num_beams,1" db:"num_beams" json:"num_beams,omitempty"` + DoSample *bool `thrift:"do_sample,2" db:"do_sample" json:"do_sample,omitempty"` + Temperature *float64 `thrift:"temperature,3" db:"temperature" json:"temperature,omitempty"` + TopP *float64 `thrift:"top_p,4" db:"top_p" json:"top_p,omitempty"` + TopK *int32 `thrift:"top_k,5" db:"top_k" json:"top_k,omitempty"` + MaxNewTokens *int32 `thrift:"max_new_tokens,6" db:"max_new_tokens" json:"max_new_tokens,omitempty"` + RepetitionPenalty *float64 `thrift:"repetition_penalty,7" db:"repetition_penalty" json:"repetition_penalty,omitempty"` + LengthPenalty *float64 `thrift:"length_penalty,8" db:"length_penalty" json:"length_penalty,omitempty"` +} + +func NewGenerationConfig() *GenerationConfig { + return &GenerationConfig{} +} + +var GenerationConfig_NumBeams_DEFAULT int32 +func (p *GenerationConfig) GetNumBeams() int32 { + if !p.IsSetNumBeams() { + return GenerationConfig_NumBeams_DEFAULT + } +return *p.NumBeams +} +var GenerationConfig_DoSample_DEFAULT bool +func (p *GenerationConfig) GetDoSample() bool { + if !p.IsSetDoSample() { + return GenerationConfig_DoSample_DEFAULT + } +return *p.DoSample +} +var GenerationConfig_Temperature_DEFAULT float64 +func (p *GenerationConfig) GetTemperature() float64 { + if !p.IsSetTemperature() { + return GenerationConfig_Temperature_DEFAULT + } +return *p.Temperature +} +var GenerationConfig_TopP_DEFAULT float64 +func (p *GenerationConfig) GetTopP() float64 { + if !p.IsSetTopP() { + return GenerationConfig_TopP_DEFAULT + } +return *p.TopP +} +var GenerationConfig_TopK_DEFAULT int32 +func (p *GenerationConfig) GetTopK() int32 { + if !p.IsSetTopK() { + return GenerationConfig_TopK_DEFAULT + } +return *p.TopK +} +var GenerationConfig_MaxNewTokens_DEFAULT int32 +func (p *GenerationConfig) GetMaxNewTokens() int32 { + if !p.IsSetMaxNewTokens() { + return GenerationConfig_MaxNewTokens_DEFAULT + } +return *p.MaxNewTokens +} +var GenerationConfig_RepetitionPenalty_DEFAULT float64 +func (p *GenerationConfig) GetRepetitionPenalty() float64 { + if !p.IsSetRepetitionPenalty() { + return GenerationConfig_RepetitionPenalty_DEFAULT + } +return *p.RepetitionPenalty +} +var GenerationConfig_LengthPenalty_DEFAULT float64 +func (p *GenerationConfig) GetLengthPenalty() float64 { + if !p.IsSetLengthPenalty() { + return GenerationConfig_LengthPenalty_DEFAULT + } +return *p.LengthPenalty +} +func (p *GenerationConfig) IsSetNumBeams() bool { + return p.NumBeams != nil +} + +func (p *GenerationConfig) IsSetDoSample() bool { + return p.DoSample != nil +} + +func (p *GenerationConfig) IsSetTemperature() bool { + return p.Temperature != nil +} + +func (p *GenerationConfig) IsSetTopP() bool { + return p.TopP != nil +} + +func (p *GenerationConfig) IsSetTopK() bool { + return p.TopK != nil +} + +func (p *GenerationConfig) IsSetMaxNewTokens() bool { + return p.MaxNewTokens != nil +} + +func (p *GenerationConfig) IsSetRepetitionPenalty() bool { + return p.RepetitionPenalty != nil +} + +func (p *GenerationConfig) IsSetLengthPenalty() bool { + return p.LengthPenalty != nil +} + +func (p *GenerationConfig) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField8(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GenerationConfig) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.NumBeams = &v +} + return nil +} + +func (p *GenerationConfig) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DoSample = &v +} + return nil +} + +func (p *GenerationConfig) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Temperature = &v +} + return nil +} + +func (p *GenerationConfig) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.TopP = &v +} + return nil +} + +func (p *GenerationConfig) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.TopK = &v +} + return nil +} + +func (p *GenerationConfig) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.MaxNewTokens = &v +} + return nil +} + +func (p *GenerationConfig) ReadField7(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.RepetitionPenalty = &v +} + return nil +} + +func (p *GenerationConfig) ReadField8(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.LengthPenalty = &v +} + return nil +} + +func (p *GenerationConfig) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("GenerationConfig"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + if err := p.writeField8(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GenerationConfig) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetNumBeams() { + if err := oprot.WriteFieldBegin("num_beams", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:num_beams: ", p), err) } + if err := oprot.WriteI32(int32(*p.NumBeams)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.num_beams (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:num_beams: ", p), err) } + } + return err +} + +func (p *GenerationConfig) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDoSample() { + if err := oprot.WriteFieldBegin("do_sample", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:do_sample: ", p), err) } + if err := oprot.WriteBool(bool(*p.DoSample)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.do_sample (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:do_sample: ", p), err) } + } + return err +} + +func (p *GenerationConfig) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetTemperature() { + if err := oprot.WriteFieldBegin("temperature", thrift.DOUBLE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:temperature: ", p), err) } + if err := oprot.WriteDouble(float64(*p.Temperature)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.temperature (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:temperature: ", p), err) } + } + return err +} + +func (p *GenerationConfig) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTopP() { + if err := oprot.WriteFieldBegin("top_p", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:top_p: ", p), err) } + if err := oprot.WriteDouble(float64(*p.TopP)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.top_p (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:top_p: ", p), err) } + } + return err +} + +func (p *GenerationConfig) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetTopK() { + if err := oprot.WriteFieldBegin("top_k", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:top_k: ", p), err) } + if err := oprot.WriteI32(int32(*p.TopK)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.top_k (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:top_k: ", p), err) } + } + return err +} + +func (p *GenerationConfig) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetMaxNewTokens() { + if err := oprot.WriteFieldBegin("max_new_tokens", thrift.I32, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:max_new_tokens: ", p), err) } + if err := oprot.WriteI32(int32(*p.MaxNewTokens)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_new_tokens (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:max_new_tokens: ", p), err) } + } + return err +} + +func (p *GenerationConfig) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetRepetitionPenalty() { + if err := oprot.WriteFieldBegin("repetition_penalty", thrift.DOUBLE, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:repetition_penalty: ", p), err) } + if err := oprot.WriteDouble(float64(*p.RepetitionPenalty)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.repetition_penalty (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:repetition_penalty: ", p), err) } + } + return err +} + +func (p *GenerationConfig) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetLengthPenalty() { + if err := oprot.WriteFieldBegin("length_penalty", thrift.DOUBLE, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:length_penalty: ", p), err) } + if err := oprot.WriteDouble(float64(*p.LengthPenalty)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.length_penalty (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:length_penalty: ", p), err) } + } + return err +} + +func (p *GenerationConfig) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GenerationConfig(%+v)", *p) +} + diff --git a/types/llm-inference/golang/com/inference/rest/GoUnusedProtection__.go b/types/llm-inference/golang/com/inference/rest/GoUnusedProtection__.go new file mode 100644 index 0000000..1783af8 --- /dev/null +++ b/types/llm-inference/golang/com/inference/rest/GoUnusedProtection__.go @@ -0,0 +1,7 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package rest + +var GoUnusedProtection__ int; + diff --git a/types/llm-inference/golang/com/inference/rest/com.inference.rest-consts.go b/types/llm-inference/golang/com/inference/rest/com.inference.rest-consts.go new file mode 100644 index 0000000..18bd91a --- /dev/null +++ b/types/llm-inference/golang/com/inference/rest/com.inference.rest-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package rest + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "com/inference/common" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = common.GoUnusedProtection__ + +func init() { +} + diff --git a/types/llm-inference/golang/com/inference/rest/com.inference.rest.go b/types/llm-inference/golang/com/inference/rest/com.inference.rest.go new file mode 100644 index 0000000..08dc0ca --- /dev/null +++ b/types/llm-inference/golang/com/inference/rest/com.inference.rest.go @@ -0,0 +1,874 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package rest + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "com/inference/common" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = common.GoUnusedProtection__ +// Attributes: +// - RequestID +// - Prompt +// - StreamResponse +// - OnlyNewTokens +// - GenerationConfig +type ApiSinglePromptRequest struct { + RequestID string `thrift:"request_id,1,required" db:"request_id" json:"request_id"` + Prompt *string `thrift:"prompt,2" db:"prompt" json:"prompt,omitempty"` + StreamResponse *bool `thrift:"stream_response,3" db:"stream_response" json:"stream_response,omitempty"` + OnlyNewTokens *bool `thrift:"only_new_tokens,4" db:"only_new_tokens" json:"only_new_tokens,omitempty"` + GenerationConfig *common.GenerationConfig `thrift:"generation_config,5" db:"generation_config" json:"generation_config,omitempty"` +} + +func NewApiSinglePromptRequest() *ApiSinglePromptRequest { + return &ApiSinglePromptRequest{} +} + + +func (p *ApiSinglePromptRequest) GetRequestID() string { + return p.RequestID +} +var ApiSinglePromptRequest_Prompt_DEFAULT string +func (p *ApiSinglePromptRequest) GetPrompt() string { + if !p.IsSetPrompt() { + return ApiSinglePromptRequest_Prompt_DEFAULT + } +return *p.Prompt +} +var ApiSinglePromptRequest_StreamResponse_DEFAULT bool +func (p *ApiSinglePromptRequest) GetStreamResponse() bool { + if !p.IsSetStreamResponse() { + return ApiSinglePromptRequest_StreamResponse_DEFAULT + } +return *p.StreamResponse +} +var ApiSinglePromptRequest_OnlyNewTokens_DEFAULT bool +func (p *ApiSinglePromptRequest) GetOnlyNewTokens() bool { + if !p.IsSetOnlyNewTokens() { + return ApiSinglePromptRequest_OnlyNewTokens_DEFAULT + } +return *p.OnlyNewTokens +} +var ApiSinglePromptRequest_GenerationConfig_DEFAULT *common.GenerationConfig +func (p *ApiSinglePromptRequest) GetGenerationConfig() *common.GenerationConfig { + if !p.IsSetGenerationConfig() { + return ApiSinglePromptRequest_GenerationConfig_DEFAULT + } +return p.GenerationConfig +} +func (p *ApiSinglePromptRequest) IsSetPrompt() bool { + return p.Prompt != nil +} + +func (p *ApiSinglePromptRequest) IsSetStreamResponse() bool { + return p.StreamResponse != nil +} + +func (p *ApiSinglePromptRequest) IsSetOnlyNewTokens() bool { + return p.OnlyNewTokens != nil +} + +func (p *ApiSinglePromptRequest) IsSetGenerationConfig() bool { + return p.GenerationConfig != nil +} + +func (p *ApiSinglePromptRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetRequestID bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + issetRequestID = true + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRequestID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field RequestID is not set")); + } + return nil +} + +func (p *ApiSinglePromptRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *ApiSinglePromptRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prompt = &v +} + return nil +} + +func (p *ApiSinglePromptRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.StreamResponse = &v +} + return nil +} + +func (p *ApiSinglePromptRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.OnlyNewTokens = &v +} + return nil +} + +func (p *ApiSinglePromptRequest) ReadField5(iprot thrift.TProtocol) error { + p.GenerationConfig = &common.GenerationConfig{} + if err := p.GenerationConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GenerationConfig), err) + } + return nil +} + +func (p *ApiSinglePromptRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ApiSinglePromptRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ApiSinglePromptRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *ApiSinglePromptRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPrompt() { + if err := oprot.WriteFieldBegin("prompt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prompt: ", p), err) } + if err := oprot.WriteString(string(*p.Prompt)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prompt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prompt: ", p), err) } + } + return err +} + +func (p *ApiSinglePromptRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetStreamResponse() { + if err := oprot.WriteFieldBegin("stream_response", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stream_response: ", p), err) } + if err := oprot.WriteBool(bool(*p.StreamResponse)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stream_response (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stream_response: ", p), err) } + } + return err +} + +func (p *ApiSinglePromptRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetOnlyNewTokens() { + if err := oprot.WriteFieldBegin("only_new_tokens", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:only_new_tokens: ", p), err) } + if err := oprot.WriteBool(bool(*p.OnlyNewTokens)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_new_tokens (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:only_new_tokens: ", p), err) } + } + return err +} + +func (p *ApiSinglePromptRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetGenerationConfig() { + if err := oprot.WriteFieldBegin("generation_config", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:generation_config: ", p), err) } + if err := p.GenerationConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GenerationConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:generation_config: ", p), err) } + } + return err +} + +func (p *ApiSinglePromptRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ApiSinglePromptRequest(%+v)", *p) +} + +// Attributes: +// - Text +type ApiSinglePromptStream struct { + Text string `thrift:"text,1" db:"text" json:"text"` +} + +func NewApiSinglePromptStream() *ApiSinglePromptStream { + return &ApiSinglePromptStream{} +} + + +func (p *ApiSinglePromptStream) GetText() string { + return p.Text +} +func (p *ApiSinglePromptStream) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ApiSinglePromptStream) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Text = v +} + return nil +} + +func (p *ApiSinglePromptStream) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ApiSinglePromptStream"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ApiSinglePromptStream) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("text", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:text: ", p), err) } + if err := oprot.WriteString(string(p.Text)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.text (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:text: ", p), err) } + return err +} + +func (p *ApiSinglePromptStream) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ApiSinglePromptStream(%+v)", *p) +} + +// Attributes: +// - Prompts +// - OnlyNewTokens +// - GenerationConfig +type ApiBatchPromptRequest struct { + Prompts []*common.SinglePrompt `thrift:"prompts,1" db:"prompts" json:"prompts"` + OnlyNewTokens *bool `thrift:"only_new_tokens,2" db:"only_new_tokens" json:"only_new_tokens,omitempty"` + GenerationConfig *common.GenerationConfig `thrift:"generation_config,3" db:"generation_config" json:"generation_config,omitempty"` +} + +func NewApiBatchPromptRequest() *ApiBatchPromptRequest { + return &ApiBatchPromptRequest{} +} + + +func (p *ApiBatchPromptRequest) GetPrompts() []*common.SinglePrompt { + return p.Prompts +} +var ApiBatchPromptRequest_OnlyNewTokens_DEFAULT bool +func (p *ApiBatchPromptRequest) GetOnlyNewTokens() bool { + if !p.IsSetOnlyNewTokens() { + return ApiBatchPromptRequest_OnlyNewTokens_DEFAULT + } +return *p.OnlyNewTokens +} +var ApiBatchPromptRequest_GenerationConfig_DEFAULT *common.GenerationConfig +func (p *ApiBatchPromptRequest) GetGenerationConfig() *common.GenerationConfig { + if !p.IsSetGenerationConfig() { + return ApiBatchPromptRequest_GenerationConfig_DEFAULT + } +return p.GenerationConfig +} +func (p *ApiBatchPromptRequest) IsSetOnlyNewTokens() bool { + return p.OnlyNewTokens != nil +} + +func (p *ApiBatchPromptRequest) IsSetGenerationConfig() bool { + return p.GenerationConfig != nil +} + +func (p *ApiBatchPromptRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ApiBatchPromptRequest) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*common.SinglePrompt, 0, size) + p.Prompts = tSlice + for i := 0; i < size; i ++ { + _elem0 := &common.SinglePrompt{} + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Prompts = append(p.Prompts, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ApiBatchPromptRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.OnlyNewTokens = &v +} + return nil +} + +func (p *ApiBatchPromptRequest) ReadField3(iprot thrift.TProtocol) error { + p.GenerationConfig = &common.GenerationConfig{} + if err := p.GenerationConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GenerationConfig), err) + } + return nil +} + +func (p *ApiBatchPromptRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ApiBatchPromptRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ApiBatchPromptRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("prompts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:prompts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Prompts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Prompts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:prompts: ", p), err) } + return err +} + +func (p *ApiBatchPromptRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetOnlyNewTokens() { + if err := oprot.WriteFieldBegin("only_new_tokens", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:only_new_tokens: ", p), err) } + if err := oprot.WriteBool(bool(*p.OnlyNewTokens)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_new_tokens (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:only_new_tokens: ", p), err) } + } + return err +} + +func (p *ApiBatchPromptRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetGenerationConfig() { + if err := oprot.WriteFieldBegin("generation_config", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:generation_config: ", p), err) } + if err := p.GenerationConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GenerationConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:generation_config: ", p), err) } + } + return err +} + +func (p *ApiBatchPromptRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ApiBatchPromptRequest(%+v)", *p) +} + +// Attributes: +// - RequestID +// - Prompt +// - Response +type ApiBatchPrompt struct { + RequestID string `thrift:"request_id,1" db:"request_id" json:"request_id"` + Prompt *string `thrift:"prompt,2" db:"prompt" json:"prompt,omitempty"` + Response string `thrift:"response,3" db:"response" json:"response"` +} + +func NewApiBatchPrompt() *ApiBatchPrompt { + return &ApiBatchPrompt{} +} + + +func (p *ApiBatchPrompt) GetRequestID() string { + return p.RequestID +} +var ApiBatchPrompt_Prompt_DEFAULT string +func (p *ApiBatchPrompt) GetPrompt() string { + if !p.IsSetPrompt() { + return ApiBatchPrompt_Prompt_DEFAULT + } +return *p.Prompt +} + +func (p *ApiBatchPrompt) GetResponse() string { + return p.Response +} +func (p *ApiBatchPrompt) IsSetPrompt() bool { + return p.Prompt != nil +} + +func (p *ApiBatchPrompt) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ApiBatchPrompt) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *ApiBatchPrompt) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prompt = &v +} + return nil +} + +func (p *ApiBatchPrompt) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Response = v +} + return nil +} + +func (p *ApiBatchPrompt) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ApiBatchPrompt"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ApiBatchPrompt) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *ApiBatchPrompt) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetPrompt() { + if err := oprot.WriteFieldBegin("prompt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prompt: ", p), err) } + if err := oprot.WriteString(string(*p.Prompt)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prompt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prompt: ", p), err) } + } + return err +} + +func (p *ApiBatchPrompt) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("response", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:response: ", p), err) } + if err := oprot.WriteString(string(p.Response)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.response (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:response: ", p), err) } + return err +} + +func (p *ApiBatchPrompt) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ApiBatchPrompt(%+v)", *p) +} + +// Attributes: +// - Responses +type ApiBatchPromptResponse struct { + Responses []*ApiBatchPrompt `thrift:"responses,1" db:"responses" json:"responses"` +} + +func NewApiBatchPromptResponse() *ApiBatchPromptResponse { + return &ApiBatchPromptResponse{} +} + + +func (p *ApiBatchPromptResponse) GetResponses() []*ApiBatchPrompt { + return p.Responses +} +func (p *ApiBatchPromptResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ApiBatchPromptResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ApiBatchPrompt, 0, size) + p.Responses = tSlice + for i := 0; i < size; i ++ { + _elem1 := &ApiBatchPrompt{} + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.Responses = append(p.Responses, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ApiBatchPromptResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("ApiBatchPromptResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ApiBatchPromptResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("responses", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:responses: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Responses)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Responses { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:responses: ", p), err) } + return err +} + +func (p *ApiBatchPromptResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ApiBatchPromptResponse(%+v)", *p) +} + diff --git a/types/llm-inference/golang/com/inference/ws/GoUnusedProtection__.go b/types/llm-inference/golang/com/inference/ws/GoUnusedProtection__.go new file mode 100644 index 0000000..ad2c221 --- /dev/null +++ b/types/llm-inference/golang/com/inference/ws/GoUnusedProtection__.go @@ -0,0 +1,7 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package ws + +var GoUnusedProtection__ int; + diff --git a/types/llm-inference/golang/com/inference/ws/com.inference.ws-consts.go b/types/llm-inference/golang/com/inference/ws/com.inference.ws-consts.go new file mode 100644 index 0000000..24c71cf --- /dev/null +++ b/types/llm-inference/golang/com/inference/ws/com.inference.ws-consts.go @@ -0,0 +1,27 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package ws + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "com/inference/common" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = common.GoUnusedProtection__ + +func init() { +} + diff --git a/types/llm-inference/golang/com/inference/ws/com.inference.ws.go b/types/llm-inference/golang/com/inference/ws/com.inference.ws.go new file mode 100644 index 0000000..04c69ba --- /dev/null +++ b/types/llm-inference/golang/com/inference/ws/com.inference.ws.go @@ -0,0 +1,1674 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package ws + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" + "com/inference/common" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +var _ = common.GoUnusedProtection__ +// Attributes: +// - Prompts +// - StreamResponse +// - OnlyNewTokens +// - GenerationConfig +type WsInferenceRequest struct { + Prompts []*common.SinglePrompt `thrift:"prompts,1" db:"prompts" json:"prompts"` + StreamResponse *bool `thrift:"stream_response,2" db:"stream_response" json:"stream_response,omitempty"` + OnlyNewTokens *bool `thrift:"only_new_tokens,3" db:"only_new_tokens" json:"only_new_tokens,omitempty"` + GenerationConfig *common.GenerationConfig `thrift:"generation_config,4" db:"generation_config" json:"generation_config,omitempty"` +} + +func NewWsInferenceRequest() *WsInferenceRequest { + return &WsInferenceRequest{} +} + + +func (p *WsInferenceRequest) GetPrompts() []*common.SinglePrompt { + return p.Prompts +} +var WsInferenceRequest_StreamResponse_DEFAULT bool +func (p *WsInferenceRequest) GetStreamResponse() bool { + if !p.IsSetStreamResponse() { + return WsInferenceRequest_StreamResponse_DEFAULT + } +return *p.StreamResponse +} +var WsInferenceRequest_OnlyNewTokens_DEFAULT bool +func (p *WsInferenceRequest) GetOnlyNewTokens() bool { + if !p.IsSetOnlyNewTokens() { + return WsInferenceRequest_OnlyNewTokens_DEFAULT + } +return *p.OnlyNewTokens +} +var WsInferenceRequest_GenerationConfig_DEFAULT *common.GenerationConfig +func (p *WsInferenceRequest) GetGenerationConfig() *common.GenerationConfig { + if !p.IsSetGenerationConfig() { + return WsInferenceRequest_GenerationConfig_DEFAULT + } +return p.GenerationConfig +} +func (p *WsInferenceRequest) IsSetStreamResponse() bool { + return p.StreamResponse != nil +} + +func (p *WsInferenceRequest) IsSetOnlyNewTokens() bool { + return p.OnlyNewTokens != nil +} + +func (p *WsInferenceRequest) IsSetGenerationConfig() bool { + return p.GenerationConfig != nil +} + +func (p *WsInferenceRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceRequest) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*common.SinglePrompt, 0, size) + p.Prompts = tSlice + for i := 0; i < size; i ++ { + _elem0 := &common.SinglePrompt{} + if err := _elem0.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Prompts = append(p.Prompts, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *WsInferenceRequest) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.StreamResponse = &v +} + return nil +} + +func (p *WsInferenceRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OnlyNewTokens = &v +} + return nil +} + +func (p *WsInferenceRequest) ReadField4(iprot thrift.TProtocol) error { + p.GenerationConfig = &common.GenerationConfig{} + if err := p.GenerationConfig.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GenerationConfig), err) + } + return nil +} + +func (p *WsInferenceRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("prompts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:prompts: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Prompts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Prompts { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:prompts: ", p), err) } + return err +} + +func (p *WsInferenceRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetStreamResponse() { + if err := oprot.WriteFieldBegin("stream_response", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stream_response: ", p), err) } + if err := oprot.WriteBool(bool(*p.StreamResponse)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stream_response (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stream_response: ", p), err) } + } + return err +} + +func (p *WsInferenceRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetOnlyNewTokens() { + if err := oprot.WriteFieldBegin("only_new_tokens", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:only_new_tokens: ", p), err) } + if err := oprot.WriteBool(bool(*p.OnlyNewTokens)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_new_tokens (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:only_new_tokens: ", p), err) } + } + return err +} + +func (p *WsInferenceRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetGenerationConfig() { + if err := oprot.WriteFieldBegin("generation_config", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:generation_config: ", p), err) } + if err := p.GenerationConfig.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GenerationConfig), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:generation_config: ", p), err) } + } + return err +} + +func (p *WsInferenceRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceRequest(%+v)", *p) +} + +// Attributes: +// - RequestID +type WsInferenceAcceptedEvent struct { + RequestID string `thrift:"request_id,1" db:"request_id" json:"request_id"` +} + +func NewWsInferenceAcceptedEvent() *WsInferenceAcceptedEvent { + return &WsInferenceAcceptedEvent{} +} + + +func (p *WsInferenceAcceptedEvent) GetRequestID() string { + return p.RequestID +} +func (p *WsInferenceAcceptedEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceAcceptedEvent) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *WsInferenceAcceptedEvent) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceAcceptedEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceAcceptedEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *WsInferenceAcceptedEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceAcceptedEvent(%+v)", *p) +} + +// Attributes: +// - RequestID +type WsInferenceStartedEvent struct { + RequestID string `thrift:"request_id,1" db:"request_id" json:"request_id"` +} + +func NewWsInferenceStartedEvent() *WsInferenceStartedEvent { + return &WsInferenceStartedEvent{} +} + + +func (p *WsInferenceStartedEvent) GetRequestID() string { + return p.RequestID +} +func (p *WsInferenceStartedEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceStartedEvent) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *WsInferenceStartedEvent) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceStartedEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceStartedEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *WsInferenceStartedEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceStartedEvent(%+v)", *p) +} + +// Attributes: +// - RequestID +// - Text +type WsInferenceInitializedEvent struct { + RequestID string `thrift:"request_id,1" db:"request_id" json:"request_id"` + // unused field # 2 + Text string `thrift:"text,3" db:"text" json:"text"` +} + +func NewWsInferenceInitializedEvent() *WsInferenceInitializedEvent { + return &WsInferenceInitializedEvent{} +} + + +func (p *WsInferenceInitializedEvent) GetRequestID() string { + return p.RequestID +} + +func (p *WsInferenceInitializedEvent) GetText() string { + return p.Text +} +func (p *WsInferenceInitializedEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceInitializedEvent) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *WsInferenceInitializedEvent) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Text = v +} + return nil +} + +func (p *WsInferenceInitializedEvent) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceInitializedEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceInitializedEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *WsInferenceInitializedEvent) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("text", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:text: ", p), err) } + if err := oprot.WriteString(string(p.Text)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.text (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:text: ", p), err) } + return err +} + +func (p *WsInferenceInitializedEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceInitializedEvent(%+v)", *p) +} + +// Attributes: +// - RequestID +// - Text +type WsInferenceProgressEvent struct { + RequestID string `thrift:"request_id,1" db:"request_id" json:"request_id"` + // unused field # 2 + Text string `thrift:"text,3" db:"text" json:"text"` +} + +func NewWsInferenceProgressEvent() *WsInferenceProgressEvent { + return &WsInferenceProgressEvent{} +} + + +func (p *WsInferenceProgressEvent) GetRequestID() string { + return p.RequestID +} + +func (p *WsInferenceProgressEvent) GetText() string { + return p.Text +} +func (p *WsInferenceProgressEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceProgressEvent) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *WsInferenceProgressEvent) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Text = v +} + return nil +} + +func (p *WsInferenceProgressEvent) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceProgressEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceProgressEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *WsInferenceProgressEvent) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("text", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:text: ", p), err) } + if err := oprot.WriteString(string(p.Text)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.text (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:text: ", p), err) } + return err +} + +func (p *WsInferenceProgressEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceProgressEvent(%+v)", *p) +} + +// Attributes: +// - RequestID +// - Text +// - IsEos +// - NewTokensCount_ +// - ExecutionTime +type WsInferenceCompletionEvent struct { + RequestID string `thrift:"request_id,1" db:"request_id" json:"request_id"` + // unused field # 2 + Text string `thrift:"text,3" db:"text" json:"text"` + IsEos bool `thrift:"is_eos,4" db:"is_eos" json:"is_eos"` + NewTokensCount_ int32 `thrift:"new_tokens_count,5" db:"new_tokens_count" json:"new_tokens_count"` + ExecutionTime float64 `thrift:"execution_time,6" db:"execution_time" json:"execution_time"` +} + +func NewWsInferenceCompletionEvent() *WsInferenceCompletionEvent { + return &WsInferenceCompletionEvent{} +} + + +func (p *WsInferenceCompletionEvent) GetRequestID() string { + return p.RequestID +} + +func (p *WsInferenceCompletionEvent) GetText() string { + return p.Text +} + +func (p *WsInferenceCompletionEvent) GetIsEos() bool { + return p.IsEos +} + +func (p *WsInferenceCompletionEvent) GetNewTokensCount_() int32 { + return p.NewTokensCount_ +} + +func (p *WsInferenceCompletionEvent) GetExecutionTime() float64 { + return p.ExecutionTime +} +func (p *WsInferenceCompletionEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceCompletionEvent) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *WsInferenceCompletionEvent) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Text = v +} + return nil +} + +func (p *WsInferenceCompletionEvent) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IsEos = v +} + return nil +} + +func (p *WsInferenceCompletionEvent) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.NewTokensCount_ = v +} + return nil +} + +func (p *WsInferenceCompletionEvent) ReadField6(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.ExecutionTime = v +} + return nil +} + +func (p *WsInferenceCompletionEvent) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceCompletionEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceCompletionEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *WsInferenceCompletionEvent) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("text", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:text: ", p), err) } + if err := oprot.WriteString(string(p.Text)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.text (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:text: ", p), err) } + return err +} + +func (p *WsInferenceCompletionEvent) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_eos", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:is_eos: ", p), err) } + if err := oprot.WriteBool(bool(p.IsEos)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_eos (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:is_eos: ", p), err) } + return err +} + +func (p *WsInferenceCompletionEvent) writeField5(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("new_tokens_count", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:new_tokens_count: ", p), err) } + if err := oprot.WriteI32(int32(p.NewTokensCount_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_tokens_count (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:new_tokens_count: ", p), err) } + return err +} + +func (p *WsInferenceCompletionEvent) writeField6(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("execution_time", thrift.DOUBLE, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:execution_time: ", p), err) } + if err := oprot.WriteDouble(float64(p.ExecutionTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.execution_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:execution_time: ", p), err) } + return err +} + +func (p *WsInferenceCompletionEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceCompletionEvent(%+v)", *p) +} + +// Attributes: +// - RequestID +// - Error +type WsInferenceErrorEvent struct { + RequestID string `thrift:"request_id,1" db:"request_id" json:"request_id"` + // unused field # 2 + Error string `thrift:"error,3" db:"error" json:"error"` +} + +func NewWsInferenceErrorEvent() *WsInferenceErrorEvent { + return &WsInferenceErrorEvent{} +} + + +func (p *WsInferenceErrorEvent) GetRequestID() string { + return p.RequestID +} + +func (p *WsInferenceErrorEvent) GetError() string { + return p.Error +} +func (p *WsInferenceErrorEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceErrorEvent) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.RequestID = v +} + return nil +} + +func (p *WsInferenceErrorEvent) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Error = v +} + return nil +} + +func (p *WsInferenceErrorEvent) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceErrorEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceErrorEvent) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("request_id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:request_id: ", p), err) } + if err := oprot.WriteString(string(p.RequestID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.request_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:request_id: ", p), err) } + return err +} + +func (p *WsInferenceErrorEvent) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:error: ", p), err) } + if err := oprot.WriteString(string(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:error: ", p), err) } + return err +} + +func (p *WsInferenceErrorEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceErrorEvent(%+v)", *p) +} + +// Attributes: +// - Error +type WsErrorEvent struct { + // unused fields # 1 to 2 + Error string `thrift:"error,3" db:"error" json:"error"` +} + +func NewWsErrorEvent() *WsErrorEvent { + return &WsErrorEvent{} +} + + +func (p *WsErrorEvent) GetError() string { + return p.Error +} +func (p *WsErrorEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsErrorEvent) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Error = v +} + return nil +} + +func (p *WsErrorEvent) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsErrorEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField3(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsErrorEvent) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("error", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:error: ", p), err) } + if err := oprot.WriteString(string(p.Error)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:error: ", p), err) } + return err +} + +func (p *WsErrorEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsErrorEvent(%+v)", *p) +} + +// Attributes: +// - AcceptedEvent +// - StartedEvent +// - InitializedEvent +// - ProgressEvent +// - CompletionEvent +// - ErrorEvent +// - WsErrorEvent +type WsInferenceEvent struct { + AcceptedEvent *WsInferenceAcceptedEvent `thrift:"acceptedEvent,1" db:"acceptedEvent" json:"acceptedEvent,omitempty"` + StartedEvent *WsInferenceStartedEvent `thrift:"startedEvent,2" db:"startedEvent" json:"startedEvent,omitempty"` + InitializedEvent *WsInferenceInitializedEvent `thrift:"initializedEvent,3" db:"initializedEvent" json:"initializedEvent,omitempty"` + ProgressEvent *WsInferenceProgressEvent `thrift:"progressEvent,4" db:"progressEvent" json:"progressEvent,omitempty"` + CompletionEvent *WsInferenceCompletionEvent `thrift:"completionEvent,5" db:"completionEvent" json:"completionEvent,omitempty"` + ErrorEvent *WsInferenceErrorEvent `thrift:"errorEvent,6" db:"errorEvent" json:"errorEvent,omitempty"` + WsErrorEvent *WsInferenceErrorEvent `thrift:"wsErrorEvent,7" db:"wsErrorEvent" json:"wsErrorEvent,omitempty"` +} + +func NewWsInferenceEvent() *WsInferenceEvent { + return &WsInferenceEvent{} +} + +var WsInferenceEvent_AcceptedEvent_DEFAULT *WsInferenceAcceptedEvent +func (p *WsInferenceEvent) GetAcceptedEvent() *WsInferenceAcceptedEvent { + if !p.IsSetAcceptedEvent() { + return WsInferenceEvent_AcceptedEvent_DEFAULT + } +return p.AcceptedEvent +} +var WsInferenceEvent_StartedEvent_DEFAULT *WsInferenceStartedEvent +func (p *WsInferenceEvent) GetStartedEvent() *WsInferenceStartedEvent { + if !p.IsSetStartedEvent() { + return WsInferenceEvent_StartedEvent_DEFAULT + } +return p.StartedEvent +} +var WsInferenceEvent_InitializedEvent_DEFAULT *WsInferenceInitializedEvent +func (p *WsInferenceEvent) GetInitializedEvent() *WsInferenceInitializedEvent { + if !p.IsSetInitializedEvent() { + return WsInferenceEvent_InitializedEvent_DEFAULT + } +return p.InitializedEvent +} +var WsInferenceEvent_ProgressEvent_DEFAULT *WsInferenceProgressEvent +func (p *WsInferenceEvent) GetProgressEvent() *WsInferenceProgressEvent { + if !p.IsSetProgressEvent() { + return WsInferenceEvent_ProgressEvent_DEFAULT + } +return p.ProgressEvent +} +var WsInferenceEvent_CompletionEvent_DEFAULT *WsInferenceCompletionEvent +func (p *WsInferenceEvent) GetCompletionEvent() *WsInferenceCompletionEvent { + if !p.IsSetCompletionEvent() { + return WsInferenceEvent_CompletionEvent_DEFAULT + } +return p.CompletionEvent +} +var WsInferenceEvent_ErrorEvent_DEFAULT *WsInferenceErrorEvent +func (p *WsInferenceEvent) GetErrorEvent() *WsInferenceErrorEvent { + if !p.IsSetErrorEvent() { + return WsInferenceEvent_ErrorEvent_DEFAULT + } +return p.ErrorEvent +} +var WsInferenceEvent_WsErrorEvent_DEFAULT *WsInferenceErrorEvent +func (p *WsInferenceEvent) GetWsErrorEvent() *WsInferenceErrorEvent { + if !p.IsSetWsErrorEvent() { + return WsInferenceEvent_WsErrorEvent_DEFAULT + } +return p.WsErrorEvent +} +func (p *WsInferenceEvent) CountSetFieldsWsInferenceEvent() int { + count := 0 + if (p.IsSetAcceptedEvent()) { + count++ + } + if (p.IsSetStartedEvent()) { + count++ + } + if (p.IsSetInitializedEvent()) { + count++ + } + if (p.IsSetProgressEvent()) { + count++ + } + if (p.IsSetCompletionEvent()) { + count++ + } + if (p.IsSetErrorEvent()) { + count++ + } + if (p.IsSetWsErrorEvent()) { + count++ + } + return count + +} + +func (p *WsInferenceEvent) IsSetAcceptedEvent() bool { + return p.AcceptedEvent != nil +} + +func (p *WsInferenceEvent) IsSetStartedEvent() bool { + return p.StartedEvent != nil +} + +func (p *WsInferenceEvent) IsSetInitializedEvent() bool { + return p.InitializedEvent != nil +} + +func (p *WsInferenceEvent) IsSetProgressEvent() bool { + return p.ProgressEvent != nil +} + +func (p *WsInferenceEvent) IsSetCompletionEvent() bool { + return p.CompletionEvent != nil +} + +func (p *WsInferenceEvent) IsSetErrorEvent() bool { + return p.ErrorEvent != nil +} + +func (p *WsInferenceEvent) IsSetWsErrorEvent() bool { + return p.WsErrorEvent != nil +} + +func (p *WsInferenceEvent) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceEvent) ReadField1(iprot thrift.TProtocol) error { + p.AcceptedEvent = &WsInferenceAcceptedEvent{} + if err := p.AcceptedEvent.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.AcceptedEvent), err) + } + return nil +} + +func (p *WsInferenceEvent) ReadField2(iprot thrift.TProtocol) error { + p.StartedEvent = &WsInferenceStartedEvent{} + if err := p.StartedEvent.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StartedEvent), err) + } + return nil +} + +func (p *WsInferenceEvent) ReadField3(iprot thrift.TProtocol) error { + p.InitializedEvent = &WsInferenceInitializedEvent{} + if err := p.InitializedEvent.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InitializedEvent), err) + } + return nil +} + +func (p *WsInferenceEvent) ReadField4(iprot thrift.TProtocol) error { + p.ProgressEvent = &WsInferenceProgressEvent{} + if err := p.ProgressEvent.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressEvent), err) + } + return nil +} + +func (p *WsInferenceEvent) ReadField5(iprot thrift.TProtocol) error { + p.CompletionEvent = &WsInferenceCompletionEvent{} + if err := p.CompletionEvent.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.CompletionEvent), err) + } + return nil +} + +func (p *WsInferenceEvent) ReadField6(iprot thrift.TProtocol) error { + p.ErrorEvent = &WsInferenceErrorEvent{} + if err := p.ErrorEvent.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ErrorEvent), err) + } + return nil +} + +func (p *WsInferenceEvent) ReadField7(iprot thrift.TProtocol) error { + p.WsErrorEvent = &WsInferenceErrorEvent{} + if err := p.WsErrorEvent.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.WsErrorEvent), err) + } + return nil +} + +func (p *WsInferenceEvent) Write(oprot thrift.TProtocol) error { + if c := p.CountSetFieldsWsInferenceEvent(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) + } + if err := oprot.WriteStructBegin("WsInferenceEvent"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + if err := p.writeField6(oprot); err != nil { return err } + if err := p.writeField7(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceEvent) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetAcceptedEvent() { + if err := oprot.WriteFieldBegin("acceptedEvent", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:acceptedEvent: ", p), err) } + if err := p.AcceptedEvent.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.AcceptedEvent), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:acceptedEvent: ", p), err) } + } + return err +} + +func (p *WsInferenceEvent) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetStartedEvent() { + if err := oprot.WriteFieldBegin("startedEvent", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:startedEvent: ", p), err) } + if err := p.StartedEvent.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StartedEvent), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:startedEvent: ", p), err) } + } + return err +} + +func (p *WsInferenceEvent) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetInitializedEvent() { + if err := oprot.WriteFieldBegin("initializedEvent", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:initializedEvent: ", p), err) } + if err := p.InitializedEvent.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InitializedEvent), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:initializedEvent: ", p), err) } + } + return err +} + +func (p *WsInferenceEvent) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetProgressEvent() { + if err := oprot.WriteFieldBegin("progressEvent", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:progressEvent: ", p), err) } + if err := p.ProgressEvent.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressEvent), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:progressEvent: ", p), err) } + } + return err +} + +func (p *WsInferenceEvent) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetCompletionEvent() { + if err := oprot.WriteFieldBegin("completionEvent", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:completionEvent: ", p), err) } + if err := p.CompletionEvent.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.CompletionEvent), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:completionEvent: ", p), err) } + } + return err +} + +func (p *WsInferenceEvent) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetErrorEvent() { + if err := oprot.WriteFieldBegin("errorEvent", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:errorEvent: ", p), err) } + if err := p.ErrorEvent.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ErrorEvent), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:errorEvent: ", p), err) } + } + return err +} + +func (p *WsInferenceEvent) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetWsErrorEvent() { + if err := oprot.WriteFieldBegin("wsErrorEvent", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:wsErrorEvent: ", p), err) } + if err := p.WsErrorEvent.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.WsErrorEvent), err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:wsErrorEvent: ", p), err) } + } + return err +} + +func (p *WsInferenceEvent) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceEvent(%+v)", *p) +} + +// Attributes: +// - Events +type WsInferenceResponse struct { + Events []*WsInferenceEvent `thrift:"events,1" db:"events" json:"events"` +} + +func NewWsInferenceResponse() *WsInferenceResponse { + return &WsInferenceResponse{} +} + + +func (p *WsInferenceResponse) GetEvents() []*WsInferenceEvent { + return p.Events +} +func (p *WsInferenceResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *WsInferenceResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*WsInferenceEvent, 0, size) + p.Events = tSlice + for i := 0; i < size; i ++ { + _elem1 := &WsInferenceEvent{} + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.Events = append(p.Events, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *WsInferenceResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("WsInferenceResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *WsInferenceResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("events", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:events: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Events)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Events { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:events: ", p), err) } + return err +} + +func (p *WsInferenceResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("WsInferenceResponse(%+v)", *p) +} + diff --git a/types/llm-inference/html/com.inference.common.html b/types/llm-inference/html/com.inference.common.html new file mode 100644 index 0000000..880a304 --- /dev/null +++ b/types/llm-inference/html/com.inference.common.html @@ -0,0 +1,32 @@ + + + + + +Thrift module: com.inference.common +
+

Thrift module: com.inference.common

+ + + + + +
ModuleServicesData typesConstants
com.inference.commonGenerationConfig
+SinglePrompt
+
+

Data structures

+

Struct: SinglePrompt

+ + + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringrequired
2promptstringoptional

Struct: GenerationConfig

+ + + + + + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1num_beamsi32optional
2do_samplebooloptional
3temperaturedoubleoptional
4top_pdoubleoptional
5top_ki32optional
6max_new_tokensi32optional
7repetition_penaltydoubleoptional
8length_penaltydoubleoptional

diff --git a/types/llm-inference/html/com.inference.html b/types/llm-inference/html/com.inference.html new file mode 100644 index 0000000..25b2e83 --- /dev/null +++ b/types/llm-inference/html/com.inference.html @@ -0,0 +1,15 @@ + + + + + +Thrift module: com.inference +
+

Thrift module: com.inference

+ + + + + +
ModuleServicesData typesConstants
com.inference
+
diff --git a/types/llm-inference/html/com.inference.rest.html b/types/llm-inference/html/com.inference.rest.html new file mode 100644 index 0000000..02fba20 --- /dev/null +++ b/types/llm-inference/html/com.inference.rest.html @@ -0,0 +1,44 @@ + + + + + +Thrift module: com.inference.rest +
+

Thrift module: com.inference.rest

+ + + + + +
ModuleServicesData typesConstants
com.inference.restApiBatchPrompt
+ApiBatchPromptRequest
+ApiBatchPromptResponse
+ApiSinglePromptRequest
+ApiSinglePromptStream
+
+

Data structures

+

Struct: ApiSinglePromptRequest

+ + + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringrequired
2promptstringoptional
3stream_responsebooloptional
4only_new_tokensbooloptional
5generation_configcom.inference.common.GenerationConfigoptional

Struct: ApiSinglePromptStream

+ + +
KeyFieldTypeDescriptionRequirednessDefault value
1textstringdefault

Struct: ApiBatchPromptRequest

+ + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1promptslist<com.inference.common.SinglePrompt>default
2only_new_tokensbooloptional
3generation_configcom.inference.common.GenerationConfigoptional

Struct: ApiBatchPrompt

+ + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringdefault
2promptstringoptional
3responsestringdefault

Struct: ApiBatchPromptResponse

+ + +
KeyFieldTypeDescriptionRequirednessDefault value
1responseslist<ApiBatchPrompt>default

diff --git a/types/llm-inference/html/com.inference.ws.html b/types/llm-inference/html/com.inference.ws.html new file mode 100644 index 0000000..b0c22c3 --- /dev/null +++ b/types/llm-inference/html/com.inference.ws.html @@ -0,0 +1,72 @@ + + + + + +Thrift module: com.inference.ws +
+

Thrift module: com.inference.ws

+ + + + + +
ModuleServicesData typesConstants
com.inference.wsWsErrorEvent
+WsInferenceAcceptedEvent
+WsInferenceCompletionEvent
+WsInferenceErrorEvent
+WsInferenceEvent
+WsInferenceInitializedEvent
+WsInferenceProgressEvent
+WsInferenceRequest
+WsInferenceResponse
+WsInferenceStartedEvent
+
+

Data structures

+

Struct: WsInferenceRequest

+ + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1promptslist<com.inference.common.SinglePrompt>default
2stream_responsebooloptional
3only_new_tokensbooloptional
4generation_configcom.inference.common.GenerationConfigoptional

Struct: WsInferenceAcceptedEvent

+ + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringdefault

Struct: WsInferenceStartedEvent

+ + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringdefault

Struct: WsInferenceInitializedEvent

+ + + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringdefault
3textstringdefault

Struct: WsInferenceProgressEvent

+ + + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringdefault
3textstringdefault

Struct: WsInferenceCompletionEvent

+ + + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringdefault
3textstringdefault
4is_eosbooldefault
5new_tokens_counti32default
6execution_timedoubledefault

Struct: WsInferenceErrorEvent

+ + + +
KeyFieldTypeDescriptionRequirednessDefault value
1request_idstringdefault
3errorstringdefault

Struct: WsErrorEvent

+ + +
KeyFieldTypeDescriptionRequirednessDefault value
3errorstringdefault

Union: WsInferenceEvent

+ + + + + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1acceptedEventWsInferenceAcceptedEventoptional
2startedEventWsInferenceStartedEventoptional
3initializedEventWsInferenceInitializedEventoptional
4progressEventWsInferenceProgressEventoptional
5completionEventWsInferenceCompletionEventoptional
6errorEventWsInferenceErrorEventoptional
7wsErrorEventWsInferenceErrorEventoptional

Struct: WsInferenceResponse

+ + +
KeyFieldTypeDescriptionRequirednessDefault value
1eventslist<WsInferenceEvent>default

diff --git a/types/llm-inference/html/index.html b/types/llm-inference/html/index.html new file mode 100644 index 0000000..2661a0e --- /dev/null +++ b/types/llm-inference/html/index.html @@ -0,0 +1,42 @@ + + + +All Thrift declarations + diff --git a/types/llm-inference/html/style.css b/types/llm-inference/html/style.css new file mode 100644 index 0000000..34fd9d7 --- /dev/null +++ b/types/llm-inference/html/style.css @@ -0,0 +1,184 @@ +/*! + * Bootstrap v2.0.3 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";} +.clearfix:after{clear:both;} +.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;} +.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;} +article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} +audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} +audio:not([controls]){display:none;} +html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} +a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:hover,a:active{outline:0;} +sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;} +button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;} +button,input{*overflow:visible;line-height:normal;} +button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;} +button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield;} +input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;} +textarea{overflow:auto;vertical-align:top;} +body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-color:#ffffff;} +a{color:#0088cc;text-decoration:none;} +a:hover{color:#005580;text-decoration:underline;} +.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";} +.row:after{clear:both;} +[class*="span"]{float:left;margin-left:20px;} +.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.span12{width:940px;} +.span11{width:860px;} +.span10{width:780px;} +.span9{width:700px;} +.span8{width:620px;} +.span7{width:540px;} +.span6{width:460px;} +.span5{width:380px;} +.span4{width:300px;} +.span3{width:220px;} +.span2{width:140px;} +.span1{width:60px;} +.offset12{margin-left:980px;} +.offset11{margin-left:900px;} +.offset10{margin-left:820px;} +.offset9{margin-left:740px;} +.offset8{margin-left:660px;} +.offset7{margin-left:580px;} +.offset6{margin-left:500px;} +.offset5{margin-left:420px;} +.offset4{margin-left:340px;} +.offset3{margin-left:260px;} +.offset2{margin-left:180px;} +.offset1{margin-left:100px;} +.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} +.row-fluid:after{clear:both;} +.row-fluid [class*="span"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574%;*margin-left:2.0744680846382977%;} +.row-fluid [class*="span"]:first-child{margin-left:0;} +.row-fluid .span12{width:99.99999998999999%;*width:99.94680850063828%;} +.row-fluid .span11{width:91.489361693%;*width:91.4361702036383%;} +.row-fluid .span10{width:82.97872339599999%;*width:82.92553190663828%;} +.row-fluid .span9{width:74.468085099%;*width:74.4148936096383%;} +.row-fluid .span8{width:65.95744680199999%;*width:65.90425531263828%;} +.row-fluid .span7{width:57.446808505%;*width:57.3936170156383%;} +.row-fluid .span6{width:48.93617020799999%;*width:48.88297871863829%;} +.row-fluid .span5{width:40.425531911%;*width:40.3723404216383%;} +.row-fluid .span4{width:31.914893614%;*width:31.8617021246383%;} +.row-fluid .span3{width:23.404255317%;*width:23.3510638276383%;} +.row-fluid .span2{width:14.89361702%;*width:14.8404255306383%;} +.row-fluid .span1{width:6.382978723%;*width:6.329787233638298%;} +.container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";} +.container:after{clear:both;} +.container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";} +.container-fluid:after{clear:both;} +p{margin:0 0 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p small{font-size:11px;color:#999999;} +.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;} +h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;} +h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;} +h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;} +h3{font-size:18px;line-height:27px;}h3 small{font-size:14px;} +h4,h5,h6{line-height:18px;} +h4{font-size:14px;}h4 small{font-size:12px;} +h5{font-size:12px;} +h6{font-size:11px;color:#999999;text-transform:uppercase;} +.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;} +.page-header h1{line-height:1;} +ul,ol{padding:0;margin:0 0 9px 25px;} +ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} +ul{list-style:disc;} +ol{list-style:decimal;} +li{line-height:18px;} +ul.unstyled,ol.unstyled{margin-left:0;list-style:none;} +dl{margin-bottom:18px;} +dt,dd{line-height:18px;} +dt{font-weight:bold;line-height:17px;} +dd{margin-left:9px;} +.dl-horizontal dt{float:left;width:120px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} +.dl-horizontal dd{margin-left:130px;} +hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;} +strong{font-weight:bold;} +em{font-style:italic;} +.muted{color:#999999;} +abbr[title]{cursor:help;border-bottom:1px dotted #ddd;} +abbr.initialism{font-size:90%;text-transform:uppercase;} +blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;} +blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} +blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;} +q:before,q:after,blockquote:before,blockquote:after{content:"";} +address{display:block;margin-bottom:18px;font-style:normal;line-height:18px;} +small{font-size:100%;} +cite{font-style:normal;} +code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;} +pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12.025px;line-height:18px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:18px;} +pre code{padding:0;color:inherit;background-color:transparent;border:0;} +.pre-scrollable{max-height:340px;overflow-y:scroll;} +.label,.badge{font-size:10.998px;font-weight:bold;line-height:14px;color:#ffffff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;} +.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;} +a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;} +.label-important,.badge-important{background-color:#b94a48;} +.label-important[href],.badge-important[href]{background-color:#953b39;} +.label-warning,.badge-warning{background-color:#f89406;} +.label-warning[href],.badge-warning[href]{background-color:#c67605;} +.label-success,.badge-success{background-color:#468847;} +.label-success[href],.badge-success[href]{background-color:#356635;} +.label-info,.badge-info{background-color:#3a87ad;} +.label-info[href],.badge-info[href]{background-color:#2d6987;} +.label-inverse,.badge-inverse{background-color:#333333;} +.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;} +table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;} +.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;} +.table th{font-weight:bold;} +.table thead th{vertical-align:bottom;} +.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;} +.table tbody+tbody{border-top:2px solid #dddddd;} +.table-condensed th,.table-condensed td{padding:4px 5px;} +.table-bordered{border:1px solid #dddddd;border-collapse:separate;*border-collapse:collapsed;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;} +.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;} +.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;} +.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px;} +.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;} +.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;} +.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} +.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;} +table .span1{float:none;width:44px;margin-left:0;} +table .span2{float:none;width:124px;margin-left:0;} +table .span3{float:none;width:204px;margin-left:0;} +table .span4{float:none;width:284px;margin-left:0;} +table .span5{float:none;width:364px;margin-left:0;} +table .span6{float:none;width:444px;margin-left:0;} +table .span7{float:none;width:524px;margin-left:0;} +table .span8{float:none;width:604px;margin-left:0;} +table .span9{float:none;width:684px;margin-left:0;} +table .span10{float:none;width:764px;margin-left:0;} +table .span11{float:none;width:844px;margin-left:0;} +table .span12{float:none;width:924px;margin-left:0;} +table .span13{float:none;width:1004px;margin-left:0;} +table .span14{float:none;width:1084px;margin-left:0;} +table .span15{float:none;width:1164px;margin-left:0;} +table .span16{float:none;width:1244px;margin-left:0;} +table .span17{float:none;width:1324px;margin-left:0;} +table .span18{float:none;width:1404px;margin-left:0;} +table .span19{float:none;width:1484px;margin-left:0;} +table .span20{float:none;width:1564px;margin-left:0;} +table .span21{float:none;width:1644px;margin-left:0;} +table .span22{float:none;width:1724px;margin-left:0;} +table .span23{float:none;width:1804px;margin-left:0;} +table .span24{float:none;width:1884px;margin-left:0;} +/* Auto-generated CSS for generated Thrift docs */ +h3, h4 { margin-bottom: 6px; } +div.definition { border: 1px solid #CCC; margin-bottom: 10px; padding: 10px; } +div.extends { margin: -0.5em 0 1em 5em } +td { vertical-align: top; } +table { empty-cells: show; } +code { line-height: 20px; } +.table-bordered th, .table-bordered td { border-bottom: 1px solid #DDDDDD; } diff --git a/types/llm-inference/python/__init__.py b/types/llm-inference/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/types/llm-inference/python/com/__init__.py b/types/llm-inference/python/com/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/types/llm-inference/python/com/inference/__init__.py b/types/llm-inference/python/com/inference/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/types/llm-inference/python/com/inference/common/__init__.py b/types/llm-inference/python/com/inference/common/__init__.py new file mode 100644 index 0000000..adefd8e --- /dev/null +++ b/types/llm-inference/python/com/inference/common/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants'] diff --git a/types/llm-inference/python/com/inference/common/constants.py b/types/llm-inference/python/com/inference/common/constants.py new file mode 100644 index 0000000..bbe41d8 --- /dev/null +++ b/types/llm-inference/python/com/inference/common/constants.py @@ -0,0 +1,14 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +from .ttypes import * diff --git a/types/llm-inference/python/com/inference/common/ttypes.py b/types/llm-inference/python/com/inference/common/ttypes.py new file mode 100644 index 0000000..a84a2c5 --- /dev/null +++ b/types/llm-inference/python/com/inference/common/ttypes.py @@ -0,0 +1,240 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys + +from thrift.transport import TTransport +all_structs = [] + + +class SinglePrompt(object): + """ + Attributes: + - request_id + - prompt + + """ + + + def __init__(self, request_id=None, prompt=None,): + self.request_id = request_id + self.prompt = prompt + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.prompt = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('SinglePrompt') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + if self.prompt is not None: + oprot.writeFieldBegin('prompt', TType.STRING, 2) + oprot.writeString(self.prompt.encode('utf-8') if sys.version_info[0] == 2 else self.prompt) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.request_id is None: + raise TProtocolException(message='Required field request_id is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class GenerationConfig(object): + """ + Attributes: + - num_beams + - do_sample + - temperature + - top_p + - top_k + - max_new_tokens + - repetition_penalty + - length_penalty + + """ + + + def __init__(self, num_beams=None, do_sample=None, temperature=None, top_p=None, top_k=None, max_new_tokens=None, repetition_penalty=None, length_penalty=None,): + self.num_beams = num_beams + self.do_sample = do_sample + self.temperature = temperature + self.top_p = top_p + self.top_k = top_k + self.max_new_tokens = max_new_tokens + self.repetition_penalty = repetition_penalty + self.length_penalty = length_penalty + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.num_beams = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.do_sample = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.DOUBLE: + self.temperature = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.DOUBLE: + self.top_p = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.top_k = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I32: + self.max_new_tokens = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.DOUBLE: + self.repetition_penalty = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.DOUBLE: + self.length_penalty = iprot.readDouble() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GenerationConfig') + if self.num_beams is not None: + oprot.writeFieldBegin('num_beams', TType.I32, 1) + oprot.writeI32(self.num_beams) + oprot.writeFieldEnd() + if self.do_sample is not None: + oprot.writeFieldBegin('do_sample', TType.BOOL, 2) + oprot.writeBool(self.do_sample) + oprot.writeFieldEnd() + if self.temperature is not None: + oprot.writeFieldBegin('temperature', TType.DOUBLE, 3) + oprot.writeDouble(self.temperature) + oprot.writeFieldEnd() + if self.top_p is not None: + oprot.writeFieldBegin('top_p', TType.DOUBLE, 4) + oprot.writeDouble(self.top_p) + oprot.writeFieldEnd() + if self.top_k is not None: + oprot.writeFieldBegin('top_k', TType.I32, 5) + oprot.writeI32(self.top_k) + oprot.writeFieldEnd() + if self.max_new_tokens is not None: + oprot.writeFieldBegin('max_new_tokens', TType.I32, 6) + oprot.writeI32(self.max_new_tokens) + oprot.writeFieldEnd() + if self.repetition_penalty is not None: + oprot.writeFieldBegin('repetition_penalty', TType.DOUBLE, 7) + oprot.writeDouble(self.repetition_penalty) + oprot.writeFieldEnd() + if self.length_penalty is not None: + oprot.writeFieldBegin('length_penalty', TType.DOUBLE, 8) + oprot.writeDouble(self.length_penalty) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(SinglePrompt) +SinglePrompt.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 + (2, TType.STRING, 'prompt', 'UTF8', None, ), # 2 +) +all_structs.append(GenerationConfig) +GenerationConfig.thrift_spec = ( + None, # 0 + (1, TType.I32, 'num_beams', None, None, ), # 1 + (2, TType.BOOL, 'do_sample', None, None, ), # 2 + (3, TType.DOUBLE, 'temperature', None, None, ), # 3 + (4, TType.DOUBLE, 'top_p', None, None, ), # 4 + (5, TType.I32, 'top_k', None, None, ), # 5 + (6, TType.I32, 'max_new_tokens', None, None, ), # 6 + (7, TType.DOUBLE, 'repetition_penalty', None, None, ), # 7 + (8, TType.DOUBLE, 'length_penalty', None, None, ), # 8 +) +fix_spec(all_structs) +del all_structs diff --git a/types/llm-inference/python/com/inference/rest/__init__.py b/types/llm-inference/python/com/inference/rest/__init__.py new file mode 100644 index 0000000..adefd8e --- /dev/null +++ b/types/llm-inference/python/com/inference/rest/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants'] diff --git a/types/llm-inference/python/com/inference/rest/constants.py b/types/llm-inference/python/com/inference/rest/constants.py new file mode 100644 index 0000000..bbe41d8 --- /dev/null +++ b/types/llm-inference/python/com/inference/rest/constants.py @@ -0,0 +1,14 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +from .ttypes import * diff --git a/types/llm-inference/python/com/inference/rest/ttypes.py b/types/llm-inference/python/com/inference/rest/ttypes.py new file mode 100644 index 0000000..e348d7f --- /dev/null +++ b/types/llm-inference/python/com/inference/rest/ttypes.py @@ -0,0 +1,447 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +import com.inference.common.ttypes + +from thrift.transport import TTransport +all_structs = [] + + +class ApiSinglePromptRequest(object): + """ + Attributes: + - request_id + - prompt + - stream_response + - only_new_tokens + - generation_config + + """ + + + def __init__(self, request_id=None, prompt=None, stream_response=None, only_new_tokens=None, generation_config=None,): + self.request_id = request_id + self.prompt = prompt + self.stream_response = stream_response + self.only_new_tokens = only_new_tokens + self.generation_config = generation_config + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.prompt = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.stream_response = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.BOOL: + self.only_new_tokens = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.generation_config = com.inference.common.ttypes.GenerationConfig() + self.generation_config.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('ApiSinglePromptRequest') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + if self.prompt is not None: + oprot.writeFieldBegin('prompt', TType.STRING, 2) + oprot.writeString(self.prompt.encode('utf-8') if sys.version_info[0] == 2 else self.prompt) + oprot.writeFieldEnd() + if self.stream_response is not None: + oprot.writeFieldBegin('stream_response', TType.BOOL, 3) + oprot.writeBool(self.stream_response) + oprot.writeFieldEnd() + if self.only_new_tokens is not None: + oprot.writeFieldBegin('only_new_tokens', TType.BOOL, 4) + oprot.writeBool(self.only_new_tokens) + oprot.writeFieldEnd() + if self.generation_config is not None: + oprot.writeFieldBegin('generation_config', TType.STRUCT, 5) + self.generation_config.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.request_id is None: + raise TProtocolException(message='Required field request_id is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class ApiSinglePromptStream(object): + """ + Attributes: + - text + + """ + + + def __init__(self, text=None,): + self.text = text + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('ApiSinglePromptStream') + if self.text is not None: + oprot.writeFieldBegin('text', TType.STRING, 1) + oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class ApiBatchPromptRequest(object): + """ + Attributes: + - prompts + - only_new_tokens + - generation_config + + """ + + + def __init__(self, prompts=None, only_new_tokens=None, generation_config=None,): + self.prompts = prompts + self.only_new_tokens = only_new_tokens + self.generation_config = generation_config + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.prompts = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in range(_size0): + _elem5 = com.inference.common.ttypes.SinglePrompt() + _elem5.read(iprot) + self.prompts.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.only_new_tokens = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.generation_config = com.inference.common.ttypes.GenerationConfig() + self.generation_config.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('ApiBatchPromptRequest') + if self.prompts is not None: + oprot.writeFieldBegin('prompts', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.prompts)) + for iter6 in self.prompts: + iter6.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.only_new_tokens is not None: + oprot.writeFieldBegin('only_new_tokens', TType.BOOL, 2) + oprot.writeBool(self.only_new_tokens) + oprot.writeFieldEnd() + if self.generation_config is not None: + oprot.writeFieldBegin('generation_config', TType.STRUCT, 3) + self.generation_config.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class ApiBatchPrompt(object): + """ + Attributes: + - request_id + - prompt + - response + + """ + + + def __init__(self, request_id=None, prompt=None, response=None,): + self.request_id = request_id + self.prompt = prompt + self.response = response + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.prompt = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.response = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('ApiBatchPrompt') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + if self.prompt is not None: + oprot.writeFieldBegin('prompt', TType.STRING, 2) + oprot.writeString(self.prompt.encode('utf-8') if sys.version_info[0] == 2 else self.prompt) + oprot.writeFieldEnd() + if self.response is not None: + oprot.writeFieldBegin('response', TType.STRING, 3) + oprot.writeString(self.response.encode('utf-8') if sys.version_info[0] == 2 else self.response) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class ApiBatchPromptResponse(object): + """ + Attributes: + - responses + + """ + + + def __init__(self, responses=None,): + self.responses = responses + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.responses = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in range(_size7): + _elem12 = ApiBatchPrompt() + _elem12.read(iprot) + self.responses.append(_elem12) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('ApiBatchPromptResponse') + if self.responses is not None: + oprot.writeFieldBegin('responses', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.responses)) + for iter13 in self.responses: + iter13.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(ApiSinglePromptRequest) +ApiSinglePromptRequest.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 + (2, TType.STRING, 'prompt', 'UTF8', None, ), # 2 + (3, TType.BOOL, 'stream_response', None, None, ), # 3 + (4, TType.BOOL, 'only_new_tokens', None, None, ), # 4 + (5, TType.STRUCT, 'generation_config', [com.inference.common.ttypes.GenerationConfig, None], None, ), # 5 +) +all_structs.append(ApiSinglePromptStream) +ApiSinglePromptStream.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'text', 'UTF8', None, ), # 1 +) +all_structs.append(ApiBatchPromptRequest) +ApiBatchPromptRequest.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'prompts', (TType.STRUCT, [com.inference.common.ttypes.SinglePrompt, None], False), None, ), # 1 + (2, TType.BOOL, 'only_new_tokens', None, None, ), # 2 + (3, TType.STRUCT, 'generation_config', [com.inference.common.ttypes.GenerationConfig, None], None, ), # 3 +) +all_structs.append(ApiBatchPrompt) +ApiBatchPrompt.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 + (2, TType.STRING, 'prompt', 'UTF8', None, ), # 2 + (3, TType.STRING, 'response', 'UTF8', None, ), # 3 +) +all_structs.append(ApiBatchPromptResponse) +ApiBatchPromptResponse.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'responses', (TType.STRUCT, [ApiBatchPrompt, None], False), None, ), # 1 +) +fix_spec(all_structs) +del all_structs diff --git a/types/llm-inference/python/com/inference/ws/__init__.py b/types/llm-inference/python/com/inference/ws/__init__.py new file mode 100644 index 0000000..adefd8e --- /dev/null +++ b/types/llm-inference/python/com/inference/ws/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants'] diff --git a/types/llm-inference/python/com/inference/ws/constants.py b/types/llm-inference/python/com/inference/ws/constants.py new file mode 100644 index 0000000..bbe41d8 --- /dev/null +++ b/types/llm-inference/python/com/inference/ws/constants.py @@ -0,0 +1,14 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +from .ttypes import * diff --git a/types/llm-inference/python/com/inference/ws/ttypes.py b/types/llm-inference/python/com/inference/ws/ttypes.py new file mode 100644 index 0000000..586326f --- /dev/null +++ b/types/llm-inference/python/com/inference/ws/ttypes.py @@ -0,0 +1,863 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +import com.inference.common.ttypes + +from thrift.transport import TTransport +all_structs = [] + + +class WsInferenceRequest(object): + """ + Attributes: + - prompts + - stream_response + - only_new_tokens + - generation_config + + """ + + + def __init__(self, prompts=None, stream_response=None, only_new_tokens=None, generation_config=None,): + self.prompts = prompts + self.stream_response = stream_response + self.only_new_tokens = only_new_tokens + self.generation_config = generation_config + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.prompts = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in range(_size0): + _elem5 = com.inference.common.ttypes.SinglePrompt() + _elem5.read(iprot) + self.prompts.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.stream_response = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.only_new_tokens = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.generation_config = com.inference.common.ttypes.GenerationConfig() + self.generation_config.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceRequest') + if self.prompts is not None: + oprot.writeFieldBegin('prompts', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.prompts)) + for iter6 in self.prompts: + iter6.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.stream_response is not None: + oprot.writeFieldBegin('stream_response', TType.BOOL, 2) + oprot.writeBool(self.stream_response) + oprot.writeFieldEnd() + if self.only_new_tokens is not None: + oprot.writeFieldBegin('only_new_tokens', TType.BOOL, 3) + oprot.writeBool(self.only_new_tokens) + oprot.writeFieldEnd() + if self.generation_config is not None: + oprot.writeFieldBegin('generation_config', TType.STRUCT, 4) + self.generation_config.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceAcceptedEvent(object): + """ + Attributes: + - request_id + + """ + + + def __init__(self, request_id=None,): + self.request_id = request_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceAcceptedEvent') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceStartedEvent(object): + """ + Attributes: + - request_id + + """ + + + def __init__(self, request_id=None,): + self.request_id = request_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceStartedEvent') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceInitializedEvent(object): + """ + Attributes: + - request_id + - text + + """ + + + def __init__(self, request_id=None, text=None,): + self.request_id = request_id + self.text = text + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceInitializedEvent') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + if self.text is not None: + oprot.writeFieldBegin('text', TType.STRING, 3) + oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceProgressEvent(object): + """ + Attributes: + - request_id + - text + + """ + + + def __init__(self, request_id=None, text=None,): + self.request_id = request_id + self.text = text + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceProgressEvent') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + if self.text is not None: + oprot.writeFieldBegin('text', TType.STRING, 3) + oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceCompletionEvent(object): + """ + Attributes: + - request_id + - text + - is_eos + - new_tokens_count + - execution_time + + """ + + + def __init__(self, request_id=None, text=None, is_eos=None, new_tokens_count=None, execution_time=None,): + self.request_id = request_id + self.text = text + self.is_eos = is_eos + self.new_tokens_count = new_tokens_count + self.execution_time = execution_time + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.BOOL: + self.is_eos = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.new_tokens_count = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.DOUBLE: + self.execution_time = iprot.readDouble() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceCompletionEvent') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + if self.text is not None: + oprot.writeFieldBegin('text', TType.STRING, 3) + oprot.writeString(self.text.encode('utf-8') if sys.version_info[0] == 2 else self.text) + oprot.writeFieldEnd() + if self.is_eos is not None: + oprot.writeFieldBegin('is_eos', TType.BOOL, 4) + oprot.writeBool(self.is_eos) + oprot.writeFieldEnd() + if self.new_tokens_count is not None: + oprot.writeFieldBegin('new_tokens_count', TType.I32, 5) + oprot.writeI32(self.new_tokens_count) + oprot.writeFieldEnd() + if self.execution_time is not None: + oprot.writeFieldBegin('execution_time', TType.DOUBLE, 6) + oprot.writeDouble(self.execution_time) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceErrorEvent(object): + """ + Attributes: + - request_id + - error + + """ + + + def __init__(self, request_id=None, error=None,): + self.request_id = request_id + self.error = error + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.request_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.error = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceErrorEvent') + if self.request_id is not None: + oprot.writeFieldBegin('request_id', TType.STRING, 1) + oprot.writeString(self.request_id.encode('utf-8') if sys.version_info[0] == 2 else self.request_id) + oprot.writeFieldEnd() + if self.error is not None: + oprot.writeFieldBegin('error', TType.STRING, 3) + oprot.writeString(self.error.encode('utf-8') if sys.version_info[0] == 2 else self.error) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsErrorEvent(object): + """ + Attributes: + - error + + """ + + + def __init__(self, error=None,): + self.error = error + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 3: + if ftype == TType.STRING: + self.error = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsErrorEvent') + if self.error is not None: + oprot.writeFieldBegin('error', TType.STRING, 3) + oprot.writeString(self.error.encode('utf-8') if sys.version_info[0] == 2 else self.error) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceEvent(object): + """ + Attributes: + - acceptedEvent + - startedEvent + - initializedEvent + - progressEvent + - completionEvent + - errorEvent + - wsErrorEvent + + """ + + + def __init__(self, acceptedEvent=None, startedEvent=None, initializedEvent=None, progressEvent=None, completionEvent=None, errorEvent=None, wsErrorEvent=None,): + self.acceptedEvent = acceptedEvent + self.startedEvent = startedEvent + self.initializedEvent = initializedEvent + self.progressEvent = progressEvent + self.completionEvent = completionEvent + self.errorEvent = errorEvent + self.wsErrorEvent = wsErrorEvent + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRUCT: + self.acceptedEvent = WsInferenceAcceptedEvent() + self.acceptedEvent.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.startedEvent = WsInferenceStartedEvent() + self.startedEvent.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.initializedEvent = WsInferenceInitializedEvent() + self.initializedEvent.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.progressEvent = WsInferenceProgressEvent() + self.progressEvent.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.completionEvent = WsInferenceCompletionEvent() + self.completionEvent.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.errorEvent = WsInferenceErrorEvent() + self.errorEvent.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.wsErrorEvent = WsInferenceErrorEvent() + self.wsErrorEvent.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceEvent') + if self.acceptedEvent is not None: + oprot.writeFieldBegin('acceptedEvent', TType.STRUCT, 1) + self.acceptedEvent.write(oprot) + oprot.writeFieldEnd() + if self.startedEvent is not None: + oprot.writeFieldBegin('startedEvent', TType.STRUCT, 2) + self.startedEvent.write(oprot) + oprot.writeFieldEnd() + if self.initializedEvent is not None: + oprot.writeFieldBegin('initializedEvent', TType.STRUCT, 3) + self.initializedEvent.write(oprot) + oprot.writeFieldEnd() + if self.progressEvent is not None: + oprot.writeFieldBegin('progressEvent', TType.STRUCT, 4) + self.progressEvent.write(oprot) + oprot.writeFieldEnd() + if self.completionEvent is not None: + oprot.writeFieldBegin('completionEvent', TType.STRUCT, 5) + self.completionEvent.write(oprot) + oprot.writeFieldEnd() + if self.errorEvent is not None: + oprot.writeFieldBegin('errorEvent', TType.STRUCT, 6) + self.errorEvent.write(oprot) + oprot.writeFieldEnd() + if self.wsErrorEvent is not None: + oprot.writeFieldBegin('wsErrorEvent', TType.STRUCT, 7) + self.wsErrorEvent.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class WsInferenceResponse(object): + """ + Attributes: + - events + + """ + + + def __init__(self, events=None,): + self.events = events + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.events = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in range(_size7): + _elem12 = WsInferenceEvent() + _elem12.read(iprot) + self.events.append(_elem12) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('WsInferenceResponse') + if self.events is not None: + oprot.writeFieldBegin('events', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.events)) + for iter13 in self.events: + iter13.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(WsInferenceRequest) +WsInferenceRequest.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'prompts', (TType.STRUCT, [com.inference.common.ttypes.SinglePrompt, None], False), None, ), # 1 + (2, TType.BOOL, 'stream_response', None, None, ), # 2 + (3, TType.BOOL, 'only_new_tokens', None, None, ), # 3 + (4, TType.STRUCT, 'generation_config', [com.inference.common.ttypes.GenerationConfig, None], None, ), # 4 +) +all_structs.append(WsInferenceAcceptedEvent) +WsInferenceAcceptedEvent.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 +) +all_structs.append(WsInferenceStartedEvent) +WsInferenceStartedEvent.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 +) +all_structs.append(WsInferenceInitializedEvent) +WsInferenceInitializedEvent.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 + None, # 2 + (3, TType.STRING, 'text', 'UTF8', None, ), # 3 +) +all_structs.append(WsInferenceProgressEvent) +WsInferenceProgressEvent.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 + None, # 2 + (3, TType.STRING, 'text', 'UTF8', None, ), # 3 +) +all_structs.append(WsInferenceCompletionEvent) +WsInferenceCompletionEvent.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 + None, # 2 + (3, TType.STRING, 'text', 'UTF8', None, ), # 3 + (4, TType.BOOL, 'is_eos', None, None, ), # 4 + (5, TType.I32, 'new_tokens_count', None, None, ), # 5 + (6, TType.DOUBLE, 'execution_time', None, None, ), # 6 +) +all_structs.append(WsInferenceErrorEvent) +WsInferenceErrorEvent.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'request_id', 'UTF8', None, ), # 1 + None, # 2 + (3, TType.STRING, 'error', 'UTF8', None, ), # 3 +) +all_structs.append(WsErrorEvent) +WsErrorEvent.thrift_spec = ( + None, # 0 + None, # 1 + None, # 2 + (3, TType.STRING, 'error', 'UTF8', None, ), # 3 +) +all_structs.append(WsInferenceEvent) +WsInferenceEvent.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'acceptedEvent', [WsInferenceAcceptedEvent, None], None, ), # 1 + (2, TType.STRUCT, 'startedEvent', [WsInferenceStartedEvent, None], None, ), # 2 + (3, TType.STRUCT, 'initializedEvent', [WsInferenceInitializedEvent, None], None, ), # 3 + (4, TType.STRUCT, 'progressEvent', [WsInferenceProgressEvent, None], None, ), # 4 + (5, TType.STRUCT, 'completionEvent', [WsInferenceCompletionEvent, None], None, ), # 5 + (6, TType.STRUCT, 'errorEvent', [WsInferenceErrorEvent, None], None, ), # 6 + (7, TType.STRUCT, 'wsErrorEvent', [WsInferenceErrorEvent, None], None, ), # 7 +) +all_structs.append(WsInferenceResponse) +WsInferenceResponse.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'events', (TType.STRUCT, [WsInferenceEvent, None], False), None, ), # 1 +) +fix_spec(all_structs) +del all_structs diff --git a/types/llm-inference/thrift/com.inference.common.thrift b/types/llm-inference/thrift/com.inference.common.thrift new file mode 100644 index 0000000..087c46e --- /dev/null +++ b/types/llm-inference/thrift/com.inference.common.thrift @@ -0,0 +1,18 @@ +namespace java com.inference.common + +struct SinglePrompt { + 1: required string request_id; // Id to identify the request + 2: optional string prompt; // Request prompt text +} + +struct GenerationConfig { + 1: optional i32 num_beams; // Number of beams for beam search. More beams increase diversity of results, but slower generation. + 2: optional bool do_sample; // Whether to use sampling; set to true to have more diverse results, false for deterministic output. + 3: optional double temperature; // Controls randomness: Lower closer to 0 means less random, higher means more random. Requires do_sample:true + 4: optional double top_p; // Nucleus sampling: higher means more diversity, lower means closer to greedy decoding. + 5: optional i32 top_k; // Top-k sampling: the number of highest probability vocabulary tokens to keep for top-k-filtering. + 6: optional i32 max_new_tokens; // The maximum number of new tokens to generate. + 7: optional double repetition_penalty; // Penalty for repetition: >1 discourages repetition, <1 encourages it. + 8: optional double length_penalty; // Controls length of generated text. Values >1 encourage longer sequences, <1 shorter. +} + diff --git a/types/llm-inference/thrift/com.inference.rest.thrift b/types/llm-inference/thrift/com.inference.rest.thrift new file mode 100644 index 0000000..e6dfa0a --- /dev/null +++ b/types/llm-inference/thrift/com.inference.rest.thrift @@ -0,0 +1,31 @@ +namespace java com.inference.rest + +include "com.inference.common.thrift" + +struct ApiSinglePromptRequest { + 1: required string request_id; // Id to identify the request + 2: optional string prompt; // Request prompt + 3: optional bool stream_response; // Stream generated tokens one by one + 4: optional bool only_new_tokens; // Only return generated tokens or return prompt + generated tokens + 5: optional com.inference.common.GenerationConfig generation_config; +} + +struct ApiSinglePromptStream { + 1: string text; // Generated token text +} + +struct ApiBatchPromptRequest { + 1: list prompts; // Array of SinglePrompt + 2: optional bool only_new_tokens; // Only return generated tokens or return prompt + generated tokens + 3: optional com.inference.common.GenerationConfig generation_config; +} + +struct ApiBatchPrompt { + 1: string request_id, // Id to identify the request + 2: optional string prompt, // Request prompt if only_new_tokens is set to false + 3: string response // Generated response text +} + +struct ApiBatchPromptResponse { + 1: list responses; // List of responses +} diff --git a/types/llm-inference/thrift/com.inference.thrift b/types/llm-inference/thrift/com.inference.thrift new file mode 100644 index 0000000..81b81f8 --- /dev/null +++ b/types/llm-inference/thrift/com.inference.thrift @@ -0,0 +1,5 @@ +namespace java com.inference + +include "com.inference.common.thrift" +include "com.inference.rest.thrift" +include "com.inference.ws.thrift" \ No newline at end of file diff --git a/types/llm-inference/thrift/com.inference.ws.thrift b/types/llm-inference/thrift/com.inference.ws.thrift new file mode 100644 index 0000000..6087a80 --- /dev/null +++ b/types/llm-inference/thrift/com.inference.ws.thrift @@ -0,0 +1,59 @@ +namespace java com.inference.websocket + +include "com.inference.common.thrift" // Include your common definitions here + +struct WsInferenceRequest { + 1: list prompts; + 2: optional bool stream_response; // Stream generated tokens one by one + 3: optional bool only_new_tokens; // Only return generated tokens or return prompt + generated tokens + 4: optional com.inference.common.GenerationConfig generation_config; +} + +struct WsInferenceAcceptedEvent { + 1: string request_id; // Id to identify the request +} + +struct WsInferenceStartedEvent { + 1: string request_id; // Id to identify the request +} + +struct WsInferenceInitializedEvent { + 1: string request_id; // Id to identify the request + 3: string text; // Initial prompt if only_new_tokens is false else '' +} + +struct WsInferenceProgressEvent { + 1: string request_id; // Id to identify the request + 3: string text; // Generated token text +} + +struct WsInferenceCompletionEvent { + 1: string request_id; // Id to identify the request + 3: string text; // Generated response text + 4: bool is_eos; // Is End of Sentence - did the model finish execution or not + 5: i32 new_tokens_count; // Count of newly generated tokens + 6: double execution_time; // Time it took the model to generate the response +} + +struct WsInferenceErrorEvent { + 1: string request_id; // Id to identify the request + 3: string error; // Error description +} + +struct WsErrorEvent { + 3: string error; // Error description +} + +union WsInferenceEvent { + 1: WsInferenceAcceptedEvent acceptedEvent; + 2: WsInferenceStartedEvent startedEvent; + 3: WsInferenceInitializedEvent initializedEvent; + 4: WsInferenceProgressEvent progressEvent; + 5: WsInferenceCompletionEvent completionEvent; + 6: WsInferenceErrorEvent errorEvent; + 7: WsInferenceErrorEvent wsErrorEvent; +} + +struct WsInferenceResponse { + 1: list events; +} diff --git a/types/llm-inference/typescript/com.inference.common_types.d.ts b/types/llm-inference/typescript/com.inference.common_types.d.ts new file mode 100644 index 0000000..034e7d5 --- /dev/null +++ b/types/llm-inference/typescript/com.inference.common_types.d.ts @@ -0,0 +1,27 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +import Int64 = require('node-int64'); + + +export declare class SinglePrompt { + request_id: string; + prompt: string; + + constructor(args?: { request_id: string; prompt?: string; }); +} + +export declare class GenerationConfig { + num_beams: number; + do_sample: boolean; + temperature: number; + top_p: number; + top_k: number; + max_new_tokens: number; + repetition_penalty: number; + length_penalty: number; + + constructor(args?: { num_beams?: number; do_sample?: boolean; temperature?: number; top_p?: number; top_k?: number; max_new_tokens?: number; repetition_penalty?: number; length_penalty?: number; }); +} diff --git a/types/llm-inference/typescript/com.inference.common_types.js b/types/llm-inference/typescript/com.inference.common_types.js new file mode 100644 index 0000000..33650ca --- /dev/null +++ b/types/llm-inference/typescript/com.inference.common_types.js @@ -0,0 +1,234 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +if (typeof Int64 === 'undefined' && typeof require === 'function') { + var Int64 = require('node-int64'); +} + + +SinglePrompt = function(args) { + this.request_id = null; + this.prompt = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field request_id is unset!'); + } + if (args.prompt !== undefined && args.prompt !== null) { + this.prompt = args.prompt; + } + } +}; +SinglePrompt.prototype = {}; +SinglePrompt.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prompt = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +SinglePrompt.prototype.write = function(output) { + output.writeStructBegin('SinglePrompt'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + if (this.prompt !== null && this.prompt !== undefined) { + output.writeFieldBegin('prompt', Thrift.Type.STRING, 2); + output.writeString(this.prompt); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +GenerationConfig = function(args) { + this.num_beams = null; + this.do_sample = null; + this.temperature = null; + this.top_p = null; + this.top_k = null; + this.max_new_tokens = null; + this.repetition_penalty = null; + this.length_penalty = null; + if (args) { + if (args.num_beams !== undefined && args.num_beams !== null) { + this.num_beams = args.num_beams; + } + if (args.do_sample !== undefined && args.do_sample !== null) { + this.do_sample = args.do_sample; + } + if (args.temperature !== undefined && args.temperature !== null) { + this.temperature = args.temperature; + } + if (args.top_p !== undefined && args.top_p !== null) { + this.top_p = args.top_p; + } + if (args.top_k !== undefined && args.top_k !== null) { + this.top_k = args.top_k; + } + if (args.max_new_tokens !== undefined && args.max_new_tokens !== null) { + this.max_new_tokens = args.max_new_tokens; + } + if (args.repetition_penalty !== undefined && args.repetition_penalty !== null) { + this.repetition_penalty = args.repetition_penalty; + } + if (args.length_penalty !== undefined && args.length_penalty !== null) { + this.length_penalty = args.length_penalty; + } + } +}; +GenerationConfig.prototype = {}; +GenerationConfig.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.num_beams = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BOOL) { + this.do_sample = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.DOUBLE) { + this.temperature = input.readDouble().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.DOUBLE) { + this.top_p = input.readDouble().value; + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.top_k = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.I32) { + this.max_new_tokens = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.DOUBLE) { + this.repetition_penalty = input.readDouble().value; + } else { + input.skip(ftype); + } + break; + case 8: + if (ftype == Thrift.Type.DOUBLE) { + this.length_penalty = input.readDouble().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +GenerationConfig.prototype.write = function(output) { + output.writeStructBegin('GenerationConfig'); + if (this.num_beams !== null && this.num_beams !== undefined) { + output.writeFieldBegin('num_beams', Thrift.Type.I32, 1); + output.writeI32(this.num_beams); + output.writeFieldEnd(); + } + if (this.do_sample !== null && this.do_sample !== undefined) { + output.writeFieldBegin('do_sample', Thrift.Type.BOOL, 2); + output.writeBool(this.do_sample); + output.writeFieldEnd(); + } + if (this.temperature !== null && this.temperature !== undefined) { + output.writeFieldBegin('temperature', Thrift.Type.DOUBLE, 3); + output.writeDouble(this.temperature); + output.writeFieldEnd(); + } + if (this.top_p !== null && this.top_p !== undefined) { + output.writeFieldBegin('top_p', Thrift.Type.DOUBLE, 4); + output.writeDouble(this.top_p); + output.writeFieldEnd(); + } + if (this.top_k !== null && this.top_k !== undefined) { + output.writeFieldBegin('top_k', Thrift.Type.I32, 5); + output.writeI32(this.top_k); + output.writeFieldEnd(); + } + if (this.max_new_tokens !== null && this.max_new_tokens !== undefined) { + output.writeFieldBegin('max_new_tokens', Thrift.Type.I32, 6); + output.writeI32(this.max_new_tokens); + output.writeFieldEnd(); + } + if (this.repetition_penalty !== null && this.repetition_penalty !== undefined) { + output.writeFieldBegin('repetition_penalty', Thrift.Type.DOUBLE, 7); + output.writeDouble(this.repetition_penalty); + output.writeFieldEnd(); + } + if (this.length_penalty !== null && this.length_penalty !== undefined) { + output.writeFieldBegin('length_penalty', Thrift.Type.DOUBLE, 8); + output.writeDouble(this.length_penalty); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + diff --git a/types/llm-inference/typescript/com.inference.rest_types.d.ts b/types/llm-inference/typescript/com.inference.rest_types.d.ts new file mode 100644 index 0000000..8297419 --- /dev/null +++ b/types/llm-inference/typescript/com.inference.rest_types.d.ts @@ -0,0 +1,45 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +import Int64 = require('node-int64'); + + +export declare class ApiSinglePromptRequest { + request_id: string; + prompt: string; + stream_response: boolean; + only_new_tokens: boolean; + generation_config: GenerationConfig; + + constructor(args?: { request_id: string; prompt?: string; stream_response?: boolean; only_new_tokens?: boolean; generation_config?: GenerationConfig; }); +} + +export declare class ApiSinglePromptStream { + text: string; + + constructor(args?: { text: string; }); +} + +export declare class ApiBatchPromptRequest { + prompts: SinglePrompt[]; + only_new_tokens: boolean; + generation_config: GenerationConfig; + + constructor(args?: { prompts: SinglePrompt[]; only_new_tokens?: boolean; generation_config?: GenerationConfig; }); +} + +export declare class ApiBatchPrompt { + request_id: string; + prompt: string; + response: string; + + constructor(args?: { request_id: string; prompt?: string; response: string; }); +} + +export declare class ApiBatchPromptResponse { + responses: ApiBatchPrompt[]; + + constructor(args?: { responses: ApiBatchPrompt[]; }); +} diff --git a/types/llm-inference/typescript/com.inference.rest_types.js b/types/llm-inference/typescript/com.inference.rest_types.js new file mode 100644 index 0000000..e756afc --- /dev/null +++ b/types/llm-inference/typescript/com.inference.rest_types.js @@ -0,0 +1,415 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +if (typeof Int64 === 'undefined' && typeof require === 'function') { + var Int64 = require('node-int64'); +} + + +ApiSinglePromptRequest = function(args) { + this.request_id = null; + this.prompt = null; + this.stream_response = null; + this.only_new_tokens = null; + this.generation_config = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } else { + throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field request_id is unset!'); + } + if (args.prompt !== undefined && args.prompt !== null) { + this.prompt = args.prompt; + } + if (args.stream_response !== undefined && args.stream_response !== null) { + this.stream_response = args.stream_response; + } + if (args.only_new_tokens !== undefined && args.only_new_tokens !== null) { + this.only_new_tokens = args.only_new_tokens; + } + if (args.generation_config !== undefined && args.generation_config !== null) { + this.generation_config = new GenerationConfig(args.generation_config); + } + } +}; +ApiSinglePromptRequest.prototype = {}; +ApiSinglePromptRequest.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prompt = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.stream_response = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.BOOL) { + this.only_new_tokens = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRUCT) { + this.generation_config = new GenerationConfig(); + this.generation_config.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ApiSinglePromptRequest.prototype.write = function(output) { + output.writeStructBegin('ApiSinglePromptRequest'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + if (this.prompt !== null && this.prompt !== undefined) { + output.writeFieldBegin('prompt', Thrift.Type.STRING, 2); + output.writeString(this.prompt); + output.writeFieldEnd(); + } + if (this.stream_response !== null && this.stream_response !== undefined) { + output.writeFieldBegin('stream_response', Thrift.Type.BOOL, 3); + output.writeBool(this.stream_response); + output.writeFieldEnd(); + } + if (this.only_new_tokens !== null && this.only_new_tokens !== undefined) { + output.writeFieldBegin('only_new_tokens', Thrift.Type.BOOL, 4); + output.writeBool(this.only_new_tokens); + output.writeFieldEnd(); + } + if (this.generation_config !== null && this.generation_config !== undefined) { + output.writeFieldBegin('generation_config', Thrift.Type.STRUCT, 5); + this.generation_config.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +ApiSinglePromptStream = function(args) { + this.text = null; + if (args) { + if (args.text !== undefined && args.text !== null) { + this.text = args.text; + } + } +}; +ApiSinglePromptStream.prototype = {}; +ApiSinglePromptStream.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.text = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ApiSinglePromptStream.prototype.write = function(output) { + output.writeStructBegin('ApiSinglePromptStream'); + if (this.text !== null && this.text !== undefined) { + output.writeFieldBegin('text', Thrift.Type.STRING, 1); + output.writeString(this.text); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +ApiBatchPromptRequest = function(args) { + this.prompts = null; + this.only_new_tokens = null; + this.generation_config = null; + if (args) { + if (args.prompts !== undefined && args.prompts !== null) { + this.prompts = Thrift.copyList(args.prompts, [SinglePrompt]); + } + if (args.only_new_tokens !== undefined && args.only_new_tokens !== null) { + this.only_new_tokens = args.only_new_tokens; + } + if (args.generation_config !== undefined && args.generation_config !== null) { + this.generation_config = new GenerationConfig(args.generation_config); + } + } +}; +ApiBatchPromptRequest.prototype = {}; +ApiBatchPromptRequest.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.prompts = []; + var _rtmp31 = input.readListBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var elem3 = null; + elem3 = new SinglePrompt(); + elem3.read(input); + this.prompts.push(elem3); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BOOL) { + this.only_new_tokens = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRUCT) { + this.generation_config = new GenerationConfig(); + this.generation_config.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ApiBatchPromptRequest.prototype.write = function(output) { + output.writeStructBegin('ApiBatchPromptRequest'); + if (this.prompts !== null && this.prompts !== undefined) { + output.writeFieldBegin('prompts', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.prompts.length); + for (var iter4 in this.prompts) { + if (this.prompts.hasOwnProperty(iter4)) { + iter4 = this.prompts[iter4]; + iter4.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.only_new_tokens !== null && this.only_new_tokens !== undefined) { + output.writeFieldBegin('only_new_tokens', Thrift.Type.BOOL, 2); + output.writeBool(this.only_new_tokens); + output.writeFieldEnd(); + } + if (this.generation_config !== null && this.generation_config !== undefined) { + output.writeFieldBegin('generation_config', Thrift.Type.STRUCT, 3); + this.generation_config.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +ApiBatchPrompt = function(args) { + this.request_id = null; + this.prompt = null; + this.response = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } + if (args.prompt !== undefined && args.prompt !== null) { + this.prompt = args.prompt; + } + if (args.response !== undefined && args.response !== null) { + this.response = args.response; + } + } +}; +ApiBatchPrompt.prototype = {}; +ApiBatchPrompt.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.prompt = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.response = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ApiBatchPrompt.prototype.write = function(output) { + output.writeStructBegin('ApiBatchPrompt'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + if (this.prompt !== null && this.prompt !== undefined) { + output.writeFieldBegin('prompt', Thrift.Type.STRING, 2); + output.writeString(this.prompt); + output.writeFieldEnd(); + } + if (this.response !== null && this.response !== undefined) { + output.writeFieldBegin('response', Thrift.Type.STRING, 3); + output.writeString(this.response); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +ApiBatchPromptResponse = function(args) { + this.responses = null; + if (args) { + if (args.responses !== undefined && args.responses !== null) { + this.responses = Thrift.copyList(args.responses, [ApiBatchPrompt]); + } + } +}; +ApiBatchPromptResponse.prototype = {}; +ApiBatchPromptResponse.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.responses = []; + var _rtmp36 = input.readListBegin(); + var _size5 = _rtmp36.size || 0; + for (var _i7 = 0; _i7 < _size5; ++_i7) { + var elem8 = null; + elem8 = new ApiBatchPrompt(); + elem8.read(input); + this.responses.push(elem8); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +ApiBatchPromptResponse.prototype.write = function(output) { + output.writeStructBegin('ApiBatchPromptResponse'); + if (this.responses !== null && this.responses !== undefined) { + output.writeFieldBegin('responses', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.responses.length); + for (var iter9 in this.responses) { + if (this.responses.hasOwnProperty(iter9)) { + iter9 = this.responses[iter9]; + iter9.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + diff --git a/types/llm-inference/typescript/com.inference.ws_types.d.ts b/types/llm-inference/typescript/com.inference.ws_types.d.ts new file mode 100644 index 0000000..310bb36 --- /dev/null +++ b/types/llm-inference/typescript/com.inference.ws_types.d.ts @@ -0,0 +1,83 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +import Int64 = require('node-int64'); + + +export declare class WsInferenceRequest { + prompts: SinglePrompt[]; + stream_response: boolean; + only_new_tokens: boolean; + generation_config: GenerationConfig; + + constructor(args?: { prompts: SinglePrompt[]; stream_response?: boolean; only_new_tokens?: boolean; generation_config?: GenerationConfig; }); +} + +export declare class WsInferenceAcceptedEvent { + request_id: string; + + constructor(args?: { request_id: string; }); +} + +export declare class WsInferenceStartedEvent { + request_id: string; + + constructor(args?: { request_id: string; }); +} + +export declare class WsInferenceInitializedEvent { + request_id: string; + text: string; + + constructor(args?: { request_id: string; text: string; }); +} + +export declare class WsInferenceProgressEvent { + request_id: string; + text: string; + + constructor(args?: { request_id: string; text: string; }); +} + +export declare class WsInferenceCompletionEvent { + request_id: string; + text: string; + is_eos: boolean; + new_tokens_count: number; + execution_time: number; + + constructor(args?: { request_id: string; text: string; is_eos: boolean; new_tokens_count: number; execution_time: number; }); +} + +export declare class WsInferenceErrorEvent { + request_id: string; + error: string; + + constructor(args?: { request_id: string; error: string; }); +} + +export declare class WsErrorEvent { + error: string; + + constructor(args?: { error: string; }); +} + +export declare class WsInferenceEvent { + acceptedEvent: WsInferenceAcceptedEvent; + startedEvent: WsInferenceStartedEvent; + initializedEvent: WsInferenceInitializedEvent; + progressEvent: WsInferenceProgressEvent; + completionEvent: WsInferenceCompletionEvent; + errorEvent: WsInferenceErrorEvent; + wsErrorEvent: WsInferenceErrorEvent; + + constructor(args?: { acceptedEvent?: WsInferenceAcceptedEvent; startedEvent?: WsInferenceStartedEvent; initializedEvent?: WsInferenceInitializedEvent; progressEvent?: WsInferenceProgressEvent; completionEvent?: WsInferenceCompletionEvent; errorEvent?: WsInferenceErrorEvent; wsErrorEvent?: WsInferenceErrorEvent; }); +} + +export declare class WsInferenceResponse { + events: WsInferenceEvent[]; + + constructor(args?: { events: WsInferenceEvent[]; }); +} diff --git a/types/llm-inference/typescript/com.inference.ws_types.js b/types/llm-inference/typescript/com.inference.ws_types.js new file mode 100644 index 0000000..4a85fb0 --- /dev/null +++ b/types/llm-inference/typescript/com.inference.ws_types.js @@ -0,0 +1,788 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +if (typeof Int64 === 'undefined' && typeof require === 'function') { + var Int64 = require('node-int64'); +} + + +WsInferenceRequest = function(args) { + this.prompts = null; + this.stream_response = null; + this.only_new_tokens = null; + this.generation_config = null; + if (args) { + if (args.prompts !== undefined && args.prompts !== null) { + this.prompts = Thrift.copyList(args.prompts, [SinglePrompt]); + } + if (args.stream_response !== undefined && args.stream_response !== null) { + this.stream_response = args.stream_response; + } + if (args.only_new_tokens !== undefined && args.only_new_tokens !== null) { + this.only_new_tokens = args.only_new_tokens; + } + if (args.generation_config !== undefined && args.generation_config !== null) { + this.generation_config = new GenerationConfig(args.generation_config); + } + } +}; +WsInferenceRequest.prototype = {}; +WsInferenceRequest.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.prompts = []; + var _rtmp31 = input.readListBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var elem3 = null; + elem3 = new SinglePrompt(); + elem3.read(input); + this.prompts.push(elem3); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.BOOL) { + this.stream_response = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.only_new_tokens = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.generation_config = new GenerationConfig(); + this.generation_config.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceRequest.prototype.write = function(output) { + output.writeStructBegin('WsInferenceRequest'); + if (this.prompts !== null && this.prompts !== undefined) { + output.writeFieldBegin('prompts', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.prompts.length); + for (var iter4 in this.prompts) { + if (this.prompts.hasOwnProperty(iter4)) { + iter4 = this.prompts[iter4]; + iter4.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.stream_response !== null && this.stream_response !== undefined) { + output.writeFieldBegin('stream_response', Thrift.Type.BOOL, 2); + output.writeBool(this.stream_response); + output.writeFieldEnd(); + } + if (this.only_new_tokens !== null && this.only_new_tokens !== undefined) { + output.writeFieldBegin('only_new_tokens', Thrift.Type.BOOL, 3); + output.writeBool(this.only_new_tokens); + output.writeFieldEnd(); + } + if (this.generation_config !== null && this.generation_config !== undefined) { + output.writeFieldBegin('generation_config', Thrift.Type.STRUCT, 4); + this.generation_config.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceAcceptedEvent = function(args) { + this.request_id = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } + } +}; +WsInferenceAcceptedEvent.prototype = {}; +WsInferenceAcceptedEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceAcceptedEvent.prototype.write = function(output) { + output.writeStructBegin('WsInferenceAcceptedEvent'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceStartedEvent = function(args) { + this.request_id = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } + } +}; +WsInferenceStartedEvent.prototype = {}; +WsInferenceStartedEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceStartedEvent.prototype.write = function(output) { + output.writeStructBegin('WsInferenceStartedEvent'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceInitializedEvent = function(args) { + this.request_id = null; + this.text = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } + if (args.text !== undefined && args.text !== null) { + this.text = args.text; + } + } +}; +WsInferenceInitializedEvent.prototype = {}; +WsInferenceInitializedEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.text = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceInitializedEvent.prototype.write = function(output) { + output.writeStructBegin('WsInferenceInitializedEvent'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + if (this.text !== null && this.text !== undefined) { + output.writeFieldBegin('text', Thrift.Type.STRING, 3); + output.writeString(this.text); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceProgressEvent = function(args) { + this.request_id = null; + this.text = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } + if (args.text !== undefined && args.text !== null) { + this.text = args.text; + } + } +}; +WsInferenceProgressEvent.prototype = {}; +WsInferenceProgressEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.text = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceProgressEvent.prototype.write = function(output) { + output.writeStructBegin('WsInferenceProgressEvent'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + if (this.text !== null && this.text !== undefined) { + output.writeFieldBegin('text', Thrift.Type.STRING, 3); + output.writeString(this.text); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceCompletionEvent = function(args) { + this.request_id = null; + this.text = null; + this.is_eos = null; + this.new_tokens_count = null; + this.execution_time = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } + if (args.text !== undefined && args.text !== null) { + this.text = args.text; + } + if (args.is_eos !== undefined && args.is_eos !== null) { + this.is_eos = args.is_eos; + } + if (args.new_tokens_count !== undefined && args.new_tokens_count !== null) { + this.new_tokens_count = args.new_tokens_count; + } + if (args.execution_time !== undefined && args.execution_time !== null) { + this.execution_time = args.execution_time; + } + } +}; +WsInferenceCompletionEvent.prototype = {}; +WsInferenceCompletionEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.text = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.BOOL) { + this.is_eos = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I32) { + this.new_tokens_count = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.DOUBLE) { + this.execution_time = input.readDouble().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceCompletionEvent.prototype.write = function(output) { + output.writeStructBegin('WsInferenceCompletionEvent'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + if (this.text !== null && this.text !== undefined) { + output.writeFieldBegin('text', Thrift.Type.STRING, 3); + output.writeString(this.text); + output.writeFieldEnd(); + } + if (this.is_eos !== null && this.is_eos !== undefined) { + output.writeFieldBegin('is_eos', Thrift.Type.BOOL, 4); + output.writeBool(this.is_eos); + output.writeFieldEnd(); + } + if (this.new_tokens_count !== null && this.new_tokens_count !== undefined) { + output.writeFieldBegin('new_tokens_count', Thrift.Type.I32, 5); + output.writeI32(this.new_tokens_count); + output.writeFieldEnd(); + } + if (this.execution_time !== null && this.execution_time !== undefined) { + output.writeFieldBegin('execution_time', Thrift.Type.DOUBLE, 6); + output.writeDouble(this.execution_time); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceErrorEvent = function(args) { + this.request_id = null; + this.error = null; + if (args) { + if (args.request_id !== undefined && args.request_id !== null) { + this.request_id = args.request_id; + } + if (args.error !== undefined && args.error !== null) { + this.error = args.error; + } + } +}; +WsInferenceErrorEvent.prototype = {}; +WsInferenceErrorEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.request_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.error = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceErrorEvent.prototype.write = function(output) { + output.writeStructBegin('WsInferenceErrorEvent'); + if (this.request_id !== null && this.request_id !== undefined) { + output.writeFieldBegin('request_id', Thrift.Type.STRING, 1); + output.writeString(this.request_id); + output.writeFieldEnd(); + } + if (this.error !== null && this.error !== undefined) { + output.writeFieldBegin('error', Thrift.Type.STRING, 3); + output.writeString(this.error); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsErrorEvent = function(args) { + this.error = null; + if (args) { + if (args.error !== undefined && args.error !== null) { + this.error = args.error; + } + } +}; +WsErrorEvent.prototype = {}; +WsErrorEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 3: + if (ftype == Thrift.Type.STRING) { + this.error = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsErrorEvent.prototype.write = function(output) { + output.writeStructBegin('WsErrorEvent'); + if (this.error !== null && this.error !== undefined) { + output.writeFieldBegin('error', Thrift.Type.STRING, 3); + output.writeString(this.error); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceEvent = function(args) { + this.acceptedEvent = null; + this.startedEvent = null; + this.initializedEvent = null; + this.progressEvent = null; + this.completionEvent = null; + this.errorEvent = null; + this.wsErrorEvent = null; + if (args) { + if (args.acceptedEvent !== undefined && args.acceptedEvent !== null) { + this.acceptedEvent = new WsInferenceAcceptedEvent(args.acceptedEvent); + } + if (args.startedEvent !== undefined && args.startedEvent !== null) { + this.startedEvent = new WsInferenceStartedEvent(args.startedEvent); + } + if (args.initializedEvent !== undefined && args.initializedEvent !== null) { + this.initializedEvent = new WsInferenceInitializedEvent(args.initializedEvent); + } + if (args.progressEvent !== undefined && args.progressEvent !== null) { + this.progressEvent = new WsInferenceProgressEvent(args.progressEvent); + } + if (args.completionEvent !== undefined && args.completionEvent !== null) { + this.completionEvent = new WsInferenceCompletionEvent(args.completionEvent); + } + if (args.errorEvent !== undefined && args.errorEvent !== null) { + this.errorEvent = new WsInferenceErrorEvent(args.errorEvent); + } + if (args.wsErrorEvent !== undefined && args.wsErrorEvent !== null) { + this.wsErrorEvent = new WsInferenceErrorEvent(args.wsErrorEvent); + } + } +}; +WsInferenceEvent.prototype = {}; +WsInferenceEvent.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRUCT) { + this.acceptedEvent = new WsInferenceAcceptedEvent(); + this.acceptedEvent.read(input); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRUCT) { + this.startedEvent = new WsInferenceStartedEvent(); + this.startedEvent.read(input); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRUCT) { + this.initializedEvent = new WsInferenceInitializedEvent(); + this.initializedEvent.read(input); + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRUCT) { + this.progressEvent = new WsInferenceProgressEvent(); + this.progressEvent.read(input); + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRUCT) { + this.completionEvent = new WsInferenceCompletionEvent(); + this.completionEvent.read(input); + } else { + input.skip(ftype); + } + break; + case 6: + if (ftype == Thrift.Type.STRUCT) { + this.errorEvent = new WsInferenceErrorEvent(); + this.errorEvent.read(input); + } else { + input.skip(ftype); + } + break; + case 7: + if (ftype == Thrift.Type.STRUCT) { + this.wsErrorEvent = new WsInferenceErrorEvent(); + this.wsErrorEvent.read(input); + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceEvent.prototype.write = function(output) { + output.writeStructBegin('WsInferenceEvent'); + if (this.acceptedEvent !== null && this.acceptedEvent !== undefined) { + output.writeFieldBegin('acceptedEvent', Thrift.Type.STRUCT, 1); + this.acceptedEvent.write(output); + output.writeFieldEnd(); + } + if (this.startedEvent !== null && this.startedEvent !== undefined) { + output.writeFieldBegin('startedEvent', Thrift.Type.STRUCT, 2); + this.startedEvent.write(output); + output.writeFieldEnd(); + } + if (this.initializedEvent !== null && this.initializedEvent !== undefined) { + output.writeFieldBegin('initializedEvent', Thrift.Type.STRUCT, 3); + this.initializedEvent.write(output); + output.writeFieldEnd(); + } + if (this.progressEvent !== null && this.progressEvent !== undefined) { + output.writeFieldBegin('progressEvent', Thrift.Type.STRUCT, 4); + this.progressEvent.write(output); + output.writeFieldEnd(); + } + if (this.completionEvent !== null && this.completionEvent !== undefined) { + output.writeFieldBegin('completionEvent', Thrift.Type.STRUCT, 5); + this.completionEvent.write(output); + output.writeFieldEnd(); + } + if (this.errorEvent !== null && this.errorEvent !== undefined) { + output.writeFieldBegin('errorEvent', Thrift.Type.STRUCT, 6); + this.errorEvent.write(output); + output.writeFieldEnd(); + } + if (this.wsErrorEvent !== null && this.wsErrorEvent !== undefined) { + output.writeFieldBegin('wsErrorEvent', Thrift.Type.STRUCT, 7); + this.wsErrorEvent.write(output); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +WsInferenceResponse = function(args) { + this.events = null; + if (args) { + if (args.events !== undefined && args.events !== null) { + this.events = Thrift.copyList(args.events, [WsInferenceEvent]); + } + } +}; +WsInferenceResponse.prototype = {}; +WsInferenceResponse.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.events = []; + var _rtmp36 = input.readListBegin(); + var _size5 = _rtmp36.size || 0; + for (var _i7 = 0; _i7 < _size5; ++_i7) { + var elem8 = null; + elem8 = new WsInferenceEvent(); + elem8.read(input); + this.events.push(elem8); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 0: + input.skip(ftype); + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +WsInferenceResponse.prototype.write = function(output) { + output.writeStructBegin('WsInferenceResponse'); + if (this.events !== null && this.events !== undefined) { + output.writeFieldBegin('events', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.events.length); + for (var iter9 in this.events) { + if (this.events.hasOwnProperty(iter9)) { + iter9 = this.events[iter9]; + iter9.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + diff --git a/types/milvus-adapter-service/golang/com/milvus/nats/GoUnusedProtection__.go b/types/milvus-adapter-service/golang/com/milvus/nats/GoUnusedProtection__.go new file mode 100644 index 0000000..e6d5685 --- /dev/null +++ b/types/milvus-adapter-service/golang/com/milvus/nats/GoUnusedProtection__.go @@ -0,0 +1,7 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package nats + +var GoUnusedProtection__ int; + diff --git a/types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats-consts.go b/types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats-consts.go new file mode 100644 index 0000000..48a1b40 --- /dev/null +++ b/types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats-consts.go @@ -0,0 +1,24 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package nats + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + + +func init() { +} + diff --git a/types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats.go b/types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats.go new file mode 100644 index 0000000..4990102 --- /dev/null +++ b/types/milvus-adapter-service/golang/com/milvus/nats/com.milvus.nats.go @@ -0,0 +1,1517 @@ +// Autogenerated by Thrift Compiler (0.13.0) +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + +package nats + +import( + "bytes" + "context" + "reflect" + "fmt" + "github.com/apache/thrift/lib/go/thrift" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = context.Background +var _ = reflect.DeepEqual +var _ = bytes.Equal + +// Attributes: +// - Search +// - DocumentIds +// - Offset +// - Limit +// - Sf +type MilvusSegmentGetRequest struct { + Search string `thrift:"search,1" db:"search" json:"search"` + DocumentIds []string `thrift:"document_ids,2" db:"document_ids" json:"document_ids,omitempty"` + Offset *int16 `thrift:"offset,3" db:"offset" json:"offset,omitempty"` + Limit *int16 `thrift:"limit,4" db:"limit" json:"limit,omitempty"` + Sf *int16 `thrift:"sf,5" db:"sf" json:"sf,omitempty"` +} + +func NewMilvusSegmentGetRequest() *MilvusSegmentGetRequest { + return &MilvusSegmentGetRequest{} +} + + +func (p *MilvusSegmentGetRequest) GetSearch() string { + return p.Search +} +var MilvusSegmentGetRequest_DocumentIds_DEFAULT []string + +func (p *MilvusSegmentGetRequest) GetDocumentIds() []string { + return p.DocumentIds +} +var MilvusSegmentGetRequest_Offset_DEFAULT int16 +func (p *MilvusSegmentGetRequest) GetOffset() int16 { + if !p.IsSetOffset() { + return MilvusSegmentGetRequest_Offset_DEFAULT + } +return *p.Offset +} +var MilvusSegmentGetRequest_Limit_DEFAULT int16 +func (p *MilvusSegmentGetRequest) GetLimit() int16 { + if !p.IsSetLimit() { + return MilvusSegmentGetRequest_Limit_DEFAULT + } +return *p.Limit +} +var MilvusSegmentGetRequest_Sf_DEFAULT int16 +func (p *MilvusSegmentGetRequest) GetSf() int16 { + if !p.IsSetSf() { + return MilvusSegmentGetRequest_Sf_DEFAULT + } +return *p.Sf +} +func (p *MilvusSegmentGetRequest) IsSetDocumentIds() bool { + return p.DocumentIds != nil +} + +func (p *MilvusSegmentGetRequest) IsSetOffset() bool { + return p.Offset != nil +} + +func (p *MilvusSegmentGetRequest) IsSetLimit() bool { + return p.Limit != nil +} + +func (p *MilvusSegmentGetRequest) IsSetSf() bool { + return p.Sf != nil +} + +func (p *MilvusSegmentGetRequest) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I16 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I16 { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I16 { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MilvusSegmentGetRequest) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Search = v +} + return nil +} + +func (p *MilvusSegmentGetRequest) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + p.DocumentIds = tSlice + for i := 0; i < size; i ++ { +var _elem0 string + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem0 = v +} + p.DocumentIds = append(p.DocumentIds, _elem0) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MilvusSegmentGetRequest) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Offset = &v +} + return nil +} + +func (p *MilvusSegmentGetRequest) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *MilvusSegmentGetRequest) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Sf = &v +} + return nil +} + +func (p *MilvusSegmentGetRequest) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MilvusSegmentGetRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MilvusSegmentGetRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("search", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:search: ", p), err) } + if err := oprot.WriteString(string(p.Search)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.search (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:search: ", p), err) } + return err +} + +func (p *MilvusSegmentGetRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetDocumentIds() { + if err := oprot.WriteFieldBegin("document_ids", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:document_ids: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRING, len(p.DocumentIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.DocumentIds { + if err := oprot.WriteString(string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:document_ids: ", p), err) } + } + return err +} + +func (p *MilvusSegmentGetRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetOffset() { + if err := oprot.WriteFieldBegin("offset", thrift.I16, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:offset: ", p), err) } + if err := oprot.WriteI16(int16(*p.Offset)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.offset (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:offset: ", p), err) } + } + return err +} + +func (p *MilvusSegmentGetRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin("limit", thrift.I16, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:limit: ", p), err) } + if err := oprot.WriteI16(int16(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:limit: ", p), err) } + } + return err +} + +func (p *MilvusSegmentGetRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetSf() { + if err := oprot.WriteFieldBegin("sf", thrift.I16, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:sf: ", p), err) } + if err := oprot.WriteI16(int16(*p.Sf)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sf (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:sf: ", p), err) } + } + return err +} + +func (p *MilvusSegmentGetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MilvusSegmentGetRequest(%+v)", *p) +} + +// Attributes: +// - SegmentText +// - DocumentID +// - SectionID +// - SegmentID +type MilvusSegmentUpsertPayload struct { + SegmentText string `thrift:"segment_text,1" db:"segment_text" json:"segment_text"` + DocumentID string `thrift:"document_id,2" db:"document_id" json:"document_id"` + SectionID string `thrift:"section_id,3" db:"section_id" json:"section_id"` + SegmentID string `thrift:"segment_id,4" db:"segment_id" json:"segment_id"` +} + +func NewMilvusSegmentUpsertPayload() *MilvusSegmentUpsertPayload { + return &MilvusSegmentUpsertPayload{} +} + + +func (p *MilvusSegmentUpsertPayload) GetSegmentText() string { + return p.SegmentText +} + +func (p *MilvusSegmentUpsertPayload) GetDocumentID() string { + return p.DocumentID +} + +func (p *MilvusSegmentUpsertPayload) GetSectionID() string { + return p.SectionID +} + +func (p *MilvusSegmentUpsertPayload) GetSegmentID() string { + return p.SegmentID +} +func (p *MilvusSegmentUpsertPayload) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MilvusSegmentUpsertPayload) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SegmentText = v +} + return nil +} + +func (p *MilvusSegmentUpsertPayload) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DocumentID = v +} + return nil +} + +func (p *MilvusSegmentUpsertPayload) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SectionID = v +} + return nil +} + +func (p *MilvusSegmentUpsertPayload) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SegmentID = v +} + return nil +} + +func (p *MilvusSegmentUpsertPayload) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MilvusSegmentUpsertPayload"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MilvusSegmentUpsertPayload) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("segment_text", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:segment_text: ", p), err) } + if err := oprot.WriteString(string(p.SegmentText)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment_text (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:segment_text: ", p), err) } + return err +} + +func (p *MilvusSegmentUpsertPayload) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("document_id", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:document_id: ", p), err) } + if err := oprot.WriteString(string(p.DocumentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.document_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:document_id: ", p), err) } + return err +} + +func (p *MilvusSegmentUpsertPayload) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("section_id", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:section_id: ", p), err) } + if err := oprot.WriteString(string(p.SectionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.section_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:section_id: ", p), err) } + return err +} + +func (p *MilvusSegmentUpsertPayload) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("segment_id", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:segment_id: ", p), err) } + if err := oprot.WriteString(string(p.SegmentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:segment_id: ", p), err) } + return err +} + +func (p *MilvusSegmentUpsertPayload) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MilvusSegmentUpsertPayload(%+v)", *p) +} + +// Attributes: +// - DocumentID +// - SectionID +// - SegmentID +type MilvusSegmentDeletePayload struct { + // unused field # 1 + DocumentID string `thrift:"document_id,2" db:"document_id" json:"document_id"` + SectionID string `thrift:"section_id,3" db:"section_id" json:"section_id"` + SegmentID string `thrift:"segment_id,4" db:"segment_id" json:"segment_id"` +} + +func NewMilvusSegmentDeletePayload() *MilvusSegmentDeletePayload { + return &MilvusSegmentDeletePayload{} +} + + +func (p *MilvusSegmentDeletePayload) GetDocumentID() string { + return p.DocumentID +} + +func (p *MilvusSegmentDeletePayload) GetSectionID() string { + return p.SectionID +} + +func (p *MilvusSegmentDeletePayload) GetSegmentID() string { + return p.SegmentID +} +func (p *MilvusSegmentDeletePayload) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MilvusSegmentDeletePayload) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DocumentID = v +} + return nil +} + +func (p *MilvusSegmentDeletePayload) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SectionID = v +} + return nil +} + +func (p *MilvusSegmentDeletePayload) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SegmentID = v +} + return nil +} + +func (p *MilvusSegmentDeletePayload) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("MilvusSegmentDeletePayload"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MilvusSegmentDeletePayload) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("document_id", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:document_id: ", p), err) } + if err := oprot.WriteString(string(p.DocumentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.document_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:document_id: ", p), err) } + return err +} + +func (p *MilvusSegmentDeletePayload) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("section_id", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:section_id: ", p), err) } + if err := oprot.WriteString(string(p.SectionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.section_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:section_id: ", p), err) } + return err +} + +func (p *MilvusSegmentDeletePayload) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("segment_id", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:segment_id: ", p), err) } + if err := oprot.WriteString(string(p.SegmentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:segment_id: ", p), err) } + return err +} + +func (p *MilvusSegmentDeletePayload) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MilvusSegmentDeletePayload(%+v)", *p) +} + +// Attributes: +// - Distance +// - DocumentID +// - SectionID +// - SegmentID +type L2SegmentSearchResult_ struct { + Distance float64 `thrift:"distance,1" db:"distance" json:"distance"` + DocumentID string `thrift:"document_id,2" db:"document_id" json:"document_id"` + SectionID string `thrift:"section_id,3" db:"section_id" json:"section_id"` + SegmentID string `thrift:"segment_id,4" db:"segment_id" json:"segment_id"` +} + +func NewL2SegmentSearchResult_() *L2SegmentSearchResult_ { + return &L2SegmentSearchResult_{} +} + + +func (p *L2SegmentSearchResult_) GetDistance() float64 { + return p.Distance +} + +func (p *L2SegmentSearchResult_) GetDocumentID() string { + return p.DocumentID +} + +func (p *L2SegmentSearchResult_) GetSectionID() string { + return p.SectionID +} + +func (p *L2SegmentSearchResult_) GetSegmentID() string { + return p.SegmentID +} +func (p *L2SegmentSearchResult_) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *L2SegmentSearchResult_) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Distance = v +} + return nil +} + +func (p *L2SegmentSearchResult_) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.DocumentID = v +} + return nil +} + +func (p *L2SegmentSearchResult_) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SectionID = v +} + return nil +} + +func (p *L2SegmentSearchResult_) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SegmentID = v +} + return nil +} + +func (p *L2SegmentSearchResult_) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("L2SegmentSearchResult"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *L2SegmentSearchResult_) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("distance", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:distance: ", p), err) } + if err := oprot.WriteDouble(float64(p.Distance)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.distance (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:distance: ", p), err) } + return err +} + +func (p *L2SegmentSearchResult_) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("document_id", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:document_id: ", p), err) } + if err := oprot.WriteString(string(p.DocumentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.document_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:document_id: ", p), err) } + return err +} + +func (p *L2SegmentSearchResult_) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("section_id", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:section_id: ", p), err) } + if err := oprot.WriteString(string(p.SectionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.section_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:section_id: ", p), err) } + return err +} + +func (p *L2SegmentSearchResult_) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("segment_id", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:segment_id: ", p), err) } + if err := oprot.WriteString(string(p.SegmentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:segment_id: ", p), err) } + return err +} + +func (p *L2SegmentSearchResult_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("L2SegmentSearchResult_(%+v)", *p) +} + +// Attributes: +// - Results +// - Total +// - IsError +// - ErrorText +type L2SegmentSearchResponse struct { + Results []*L2SegmentSearchResult_ `thrift:"results,1" db:"results" json:"results"` + Total int32 `thrift:"total,2" db:"total" json:"total"` + IsError bool `thrift:"is_error,3" db:"is_error" json:"is_error"` + ErrorText *string `thrift:"error_text,4" db:"error_text" json:"error_text,omitempty"` +} + +func NewL2SegmentSearchResponse() *L2SegmentSearchResponse { + return &L2SegmentSearchResponse{} +} + + +func (p *L2SegmentSearchResponse) GetResults() []*L2SegmentSearchResult_ { + return p.Results +} + +func (p *L2SegmentSearchResponse) GetTotal() int32 { + return p.Total +} + +func (p *L2SegmentSearchResponse) GetIsError() bool { + return p.IsError +} +var L2SegmentSearchResponse_ErrorText_DEFAULT string +func (p *L2SegmentSearchResponse) GetErrorText() string { + if !p.IsSetErrorText() { + return L2SegmentSearchResponse_ErrorText_DEFAULT + } +return *p.ErrorText +} +func (p *L2SegmentSearchResponse) IsSetErrorText() bool { + return p.ErrorText != nil +} + +func (p *L2SegmentSearchResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *L2SegmentSearchResponse) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*L2SegmentSearchResult_, 0, size) + p.Results = tSlice + for i := 0; i < size; i ++ { + _elem1 := &L2SegmentSearchResult_{} + if err := _elem1.Read(iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem1), err) + } + p.Results = append(p.Results, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *L2SegmentSearchResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Total = v +} + return nil +} + +func (p *L2SegmentSearchResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IsError = v +} + return nil +} + +func (p *L2SegmentSearchResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.ErrorText = &v +} + return nil +} + +func (p *L2SegmentSearchResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("L2SegmentSearchResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *L2SegmentSearchResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("results", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:results: ", p), err) } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Results)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Results { + if err := v.Write(oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:results: ", p), err) } + return err +} + +func (p *L2SegmentSearchResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("total", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:total: ", p), err) } + if err := oprot.WriteI32(int32(p.Total)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.total (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:total: ", p), err) } + return err +} + +func (p *L2SegmentSearchResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_error", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:is_error: ", p), err) } + if err := oprot.WriteBool(bool(p.IsError)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_error (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:is_error: ", p), err) } + return err +} + +func (p *L2SegmentSearchResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetErrorText() { + if err := oprot.WriteFieldBegin("error_text", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:error_text: ", p), err) } + if err := oprot.WriteString(string(*p.ErrorText)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_text (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:error_text: ", p), err) } + } + return err +} + +func (p *L2SegmentSearchResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("L2SegmentSearchResponse(%+v)", *p) +} + +// Attributes: +// - InsertCount +// - UpdateCount +// - DeleteCount +// - IsError +// - ErrorText +type L2SegmentUpsertResponse struct { + InsertCount int32 `thrift:"insert_count,1" db:"insert_count" json:"insert_count"` + UpdateCount int32 `thrift:"update_count,2" db:"update_count" json:"update_count"` + DeleteCount int32 `thrift:"delete_count,3" db:"delete_count" json:"delete_count"` + IsError bool `thrift:"is_error,4" db:"is_error" json:"is_error"` + ErrorText *string `thrift:"error_text,5" db:"error_text" json:"error_text,omitempty"` +} + +func NewL2SegmentUpsertResponse() *L2SegmentUpsertResponse { + return &L2SegmentUpsertResponse{} +} + + +func (p *L2SegmentUpsertResponse) GetInsertCount() int32 { + return p.InsertCount +} + +func (p *L2SegmentUpsertResponse) GetUpdateCount() int32 { + return p.UpdateCount +} + +func (p *L2SegmentUpsertResponse) GetDeleteCount() int32 { + return p.DeleteCount +} + +func (p *L2SegmentUpsertResponse) GetIsError() bool { + return p.IsError +} +var L2SegmentUpsertResponse_ErrorText_DEFAULT string +func (p *L2SegmentUpsertResponse) GetErrorText() string { + if !p.IsSetErrorText() { + return L2SegmentUpsertResponse_ErrorText_DEFAULT + } +return *p.ErrorText +} +func (p *L2SegmentUpsertResponse) IsSetErrorText() bool { + return p.ErrorText != nil +} + +func (p *L2SegmentUpsertResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *L2SegmentUpsertResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.InsertCount = v +} + return nil +} + +func (p *L2SegmentUpsertResponse) ReadField2(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.UpdateCount = v +} + return nil +} + +func (p *L2SegmentUpsertResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.DeleteCount = v +} + return nil +} + +func (p *L2SegmentUpsertResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IsError = v +} + return nil +} + +func (p *L2SegmentUpsertResponse) ReadField5(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorText = &v +} + return nil +} + +func (p *L2SegmentUpsertResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("L2SegmentUpsertResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + if err := p.writeField5(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *L2SegmentUpsertResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("insert_count", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:insert_count: ", p), err) } + if err := oprot.WriteI32(int32(p.InsertCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insert_count (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:insert_count: ", p), err) } + return err +} + +func (p *L2SegmentUpsertResponse) writeField2(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("update_count", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:update_count: ", p), err) } + if err := oprot.WriteI32(int32(p.UpdateCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.update_count (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:update_count: ", p), err) } + return err +} + +func (p *L2SegmentUpsertResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("delete_count", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:delete_count: ", p), err) } + if err := oprot.WriteI32(int32(p.DeleteCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delete_count (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:delete_count: ", p), err) } + return err +} + +func (p *L2SegmentUpsertResponse) writeField4(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_error", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:is_error: ", p), err) } + if err := oprot.WriteBool(bool(p.IsError)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_error (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:is_error: ", p), err) } + return err +} + +func (p *L2SegmentUpsertResponse) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetErrorText() { + if err := oprot.WriteFieldBegin("error_text", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:error_text: ", p), err) } + if err := oprot.WriteString(string(*p.ErrorText)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_text (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:error_text: ", p), err) } + } + return err +} + +func (p *L2SegmentUpsertResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("L2SegmentUpsertResponse(%+v)", *p) +} + +// Attributes: +// - DeleteCount +// - IsError +// - ErrorText +type L2SegmentDeleteResponse struct { + DeleteCount int32 `thrift:"delete_count,1" db:"delete_count" json:"delete_count"` + // unused field # 2 + IsError bool `thrift:"is_error,3" db:"is_error" json:"is_error"` + ErrorText *string `thrift:"error_text,4" db:"error_text" json:"error_text,omitempty"` +} + +func NewL2SegmentDeleteResponse() *L2SegmentDeleteResponse { + return &L2SegmentDeleteResponse{} +} + + +func (p *L2SegmentDeleteResponse) GetDeleteCount() int32 { + return p.DeleteCount +} + +func (p *L2SegmentDeleteResponse) GetIsError() bool { + return p.IsError +} +var L2SegmentDeleteResponse_ErrorText_DEFAULT string +func (p *L2SegmentDeleteResponse) GetErrorText() string { + if !p.IsSetErrorText() { + return L2SegmentDeleteResponse_ErrorText_DEFAULT + } +return *p.ErrorText +} +func (p *L2SegmentDeleteResponse) IsSetErrorText() bool { + return p.ErrorText != nil +} + +func (p *L2SegmentDeleteResponse) Read(iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *L2SegmentDeleteResponse) ReadField1(iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.DeleteCount = v +} + return nil +} + +func (p *L2SegmentDeleteResponse) ReadField3(iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IsError = v +} + return nil +} + +func (p *L2SegmentDeleteResponse) ReadField4(iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.ErrorText = &v +} + return nil +} + +func (p *L2SegmentDeleteResponse) Write(oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin("L2SegmentDeleteResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField4(oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *L2SegmentDeleteResponse) writeField1(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("delete_count", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:delete_count: ", p), err) } + if err := oprot.WriteI32(int32(p.DeleteCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delete_count (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:delete_count: ", p), err) } + return err +} + +func (p *L2SegmentDeleteResponse) writeField3(oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin("is_error", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:is_error: ", p), err) } + if err := oprot.WriteBool(bool(p.IsError)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_error (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:is_error: ", p), err) } + return err +} + +func (p *L2SegmentDeleteResponse) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetErrorText() { + if err := oprot.WriteFieldBegin("error_text", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:error_text: ", p), err) } + if err := oprot.WriteString(string(*p.ErrorText)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_text (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:error_text: ", p), err) } + } + return err +} + +func (p *L2SegmentDeleteResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("L2SegmentDeleteResponse(%+v)", *p) +} + diff --git a/types/milvus-adapter-service/html/com.milvus.nats.html b/types/milvus-adapter-service/html/com.milvus.nats.html new file mode 100644 index 0000000..8d85bce --- /dev/null +++ b/types/milvus-adapter-service/html/com.milvus.nats.html @@ -0,0 +1,65 @@ + + + + + +Thrift module: com.milvus.nats +
+

Thrift module: com.milvus.nats

+ + + + + +
ModuleServicesData typesConstants
com.milvus.natsL2SegmentDeleteResponse
+L2SegmentSearchResponse
+L2SegmentSearchResult
+L2SegmentUpsertResponse
+MilvusSegmentDeletePayload
+MilvusSegmentGetRequest
+MilvusSegmentUpsertPayload
+
+

Data structures

+

Struct: MilvusSegmentGetRequest

+ + + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1searchstringdefault
2document_idslist<string>optional
3offseti16optional
4limiti16optional
5sfi16optional

Struct: MilvusSegmentUpsertPayload

+ + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1segment_textstringdefault
2document_idstringdefault
3section_idstringdefault
4segment_idstringdefault

Struct: MilvusSegmentDeletePayload

+ + + + +
KeyFieldTypeDescriptionRequirednessDefault value
2document_idstringdefault
3section_idstringdefault
4segment_idstringdefault

Struct: L2SegmentSearchResult

+ + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1distancedoubledefault
2document_idstringdefault
3section_idstringdefault
4segment_idstringdefault

Struct: L2SegmentSearchResponse

+ + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1resultslist<L2SegmentSearchResult>default
2totali32default
3is_errorbooldefault
4error_textstringoptional

Struct: L2SegmentUpsertResponse

+ + + + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1insert_counti32default
2update_counti32default
3delete_counti32default
4is_errorbooldefault
5error_textstringoptional

Struct: L2SegmentDeleteResponse

+ + + + +
KeyFieldTypeDescriptionRequirednessDefault value
1delete_counti32default
3is_errorbooldefault
4error_textstringoptional

diff --git a/types/milvus-adapter-service/html/index.html b/types/milvus-adapter-service/html/index.html new file mode 100644 index 0000000..27edeac --- /dev/null +++ b/types/milvus-adapter-service/html/index.html @@ -0,0 +1,20 @@ + + + +All Thrift declarations + diff --git a/types/milvus-adapter-service/html/style.css b/types/milvus-adapter-service/html/style.css new file mode 100644 index 0000000..34fd9d7 --- /dev/null +++ b/types/milvus-adapter-service/html/style.css @@ -0,0 +1,184 @@ +/*! + * Bootstrap v2.0.3 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */ +.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";} +.clearfix:after{clear:both;} +.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;} +.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;} +article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;} +audio,canvas,video{display:inline-block;*display:inline;*zoom:1;} +audio:not([controls]){display:none;} +html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;} +a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;} +a:hover,a:active{outline:0;} +sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;} +sup{top:-0.5em;} +sub{bottom:-0.25em;} +img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;} +button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;} +button,input{*overflow:visible;line-height:normal;} +button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;} +button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;} +input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield;} +input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;} +textarea{overflow:auto;vertical-align:top;} +body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-color:#ffffff;} +a{color:#0088cc;text-decoration:none;} +a:hover{color:#005580;text-decoration:underline;} +.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";} +.row:after{clear:both;} +[class*="span"]{float:left;margin-left:20px;} +.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;} +.span12{width:940px;} +.span11{width:860px;} +.span10{width:780px;} +.span9{width:700px;} +.span8{width:620px;} +.span7{width:540px;} +.span6{width:460px;} +.span5{width:380px;} +.span4{width:300px;} +.span3{width:220px;} +.span2{width:140px;} +.span1{width:60px;} +.offset12{margin-left:980px;} +.offset11{margin-left:900px;} +.offset10{margin-left:820px;} +.offset9{margin-left:740px;} +.offset8{margin-left:660px;} +.offset7{margin-left:580px;} +.offset6{margin-left:500px;} +.offset5{margin-left:420px;} +.offset4{margin-left:340px;} +.offset3{margin-left:260px;} +.offset2{margin-left:180px;} +.offset1{margin-left:100px;} +.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} +.row-fluid:after{clear:both;} +.row-fluid [class*="span"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574%;*margin-left:2.0744680846382977%;} +.row-fluid [class*="span"]:first-child{margin-left:0;} +.row-fluid .span12{width:99.99999998999999%;*width:99.94680850063828%;} +.row-fluid .span11{width:91.489361693%;*width:91.4361702036383%;} +.row-fluid .span10{width:82.97872339599999%;*width:82.92553190663828%;} +.row-fluid .span9{width:74.468085099%;*width:74.4148936096383%;} +.row-fluid .span8{width:65.95744680199999%;*width:65.90425531263828%;} +.row-fluid .span7{width:57.446808505%;*width:57.3936170156383%;} +.row-fluid .span6{width:48.93617020799999%;*width:48.88297871863829%;} +.row-fluid .span5{width:40.425531911%;*width:40.3723404216383%;} +.row-fluid .span4{width:31.914893614%;*width:31.8617021246383%;} +.row-fluid .span3{width:23.404255317%;*width:23.3510638276383%;} +.row-fluid .span2{width:14.89361702%;*width:14.8404255306383%;} +.row-fluid .span1{width:6.382978723%;*width:6.329787233638298%;} +.container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";} +.container:after{clear:both;} +.container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";} +.container-fluid:after{clear:both;} +p{margin:0 0 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p small{font-size:11px;color:#999999;} +.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;} +h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;} +h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;} +h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;} +h3{font-size:18px;line-height:27px;}h3 small{font-size:14px;} +h4,h5,h6{line-height:18px;} +h4{font-size:14px;}h4 small{font-size:12px;} +h5{font-size:12px;} +h6{font-size:11px;color:#999999;text-transform:uppercase;} +.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;} +.page-header h1{line-height:1;} +ul,ol{padding:0;margin:0 0 9px 25px;} +ul ul,ul ol,ol ol,ol ul{margin-bottom:0;} +ul{list-style:disc;} +ol{list-style:decimal;} +li{line-height:18px;} +ul.unstyled,ol.unstyled{margin-left:0;list-style:none;} +dl{margin-bottom:18px;} +dt,dd{line-height:18px;} +dt{font-weight:bold;line-height:17px;} +dd{margin-left:9px;} +.dl-horizontal dt{float:left;width:120px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;} +.dl-horizontal dd{margin-left:130px;} +hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;} +strong{font-weight:bold;} +em{font-style:italic;} +.muted{color:#999999;} +abbr[title]{cursor:help;border-bottom:1px dotted #ddd;} +abbr.initialism{font-size:90%;text-transform:uppercase;} +blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;} +blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';} +blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;} +q:before,q:after,blockquote:before,blockquote:after{content:"";} +address{display:block;margin-bottom:18px;font-style:normal;line-height:18px;} +small{font-size:100%;} +cite{font-style:normal;} +code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;} +pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12.025px;line-height:18px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:18px;} +pre code{padding:0;color:inherit;background-color:transparent;border:0;} +.pre-scrollable{max-height:340px;overflow-y:scroll;} +.label,.badge{font-size:10.998px;font-weight:bold;line-height:14px;color:#ffffff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;} +.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} +.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;} +a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;} +.label-important,.badge-important{background-color:#b94a48;} +.label-important[href],.badge-important[href]{background-color:#953b39;} +.label-warning,.badge-warning{background-color:#f89406;} +.label-warning[href],.badge-warning[href]{background-color:#c67605;} +.label-success,.badge-success{background-color:#468847;} +.label-success[href],.badge-success[href]{background-color:#356635;} +.label-info,.badge-info{background-color:#3a87ad;} +.label-info[href],.badge-info[href]{background-color:#2d6987;} +.label-inverse,.badge-inverse{background-color:#333333;} +.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;} +table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;} +.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;} +.table th{font-weight:bold;} +.table thead th{vertical-align:bottom;} +.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;} +.table tbody+tbody{border-top:2px solid #dddddd;} +.table-condensed th,.table-condensed td{padding:4px 5px;} +.table-bordered{border:1px solid #dddddd;border-collapse:separate;*border-collapse:collapsed;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;} +.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;} +.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;} +.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px;} +.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;} +.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;} +.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;} +.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;} +table .span1{float:none;width:44px;margin-left:0;} +table .span2{float:none;width:124px;margin-left:0;} +table .span3{float:none;width:204px;margin-left:0;} +table .span4{float:none;width:284px;margin-left:0;} +table .span5{float:none;width:364px;margin-left:0;} +table .span6{float:none;width:444px;margin-left:0;} +table .span7{float:none;width:524px;margin-left:0;} +table .span8{float:none;width:604px;margin-left:0;} +table .span9{float:none;width:684px;margin-left:0;} +table .span10{float:none;width:764px;margin-left:0;} +table .span11{float:none;width:844px;margin-left:0;} +table .span12{float:none;width:924px;margin-left:0;} +table .span13{float:none;width:1004px;margin-left:0;} +table .span14{float:none;width:1084px;margin-left:0;} +table .span15{float:none;width:1164px;margin-left:0;} +table .span16{float:none;width:1244px;margin-left:0;} +table .span17{float:none;width:1324px;margin-left:0;} +table .span18{float:none;width:1404px;margin-left:0;} +table .span19{float:none;width:1484px;margin-left:0;} +table .span20{float:none;width:1564px;margin-left:0;} +table .span21{float:none;width:1644px;margin-left:0;} +table .span22{float:none;width:1724px;margin-left:0;} +table .span23{float:none;width:1804px;margin-left:0;} +table .span24{float:none;width:1884px;margin-left:0;} +/* Auto-generated CSS for generated Thrift docs */ +h3, h4 { margin-bottom: 6px; } +div.definition { border: 1px solid #CCC; margin-bottom: 10px; padding: 10px; } +div.extends { margin: -0.5em 0 1em 5em } +td { vertical-align: top; } +table { empty-cells: show; } +code { line-height: 20px; } +.table-bordered th, .table-bordered td { border-bottom: 1px solid #DDDDDD; } diff --git a/types/milvus-adapter-service/python/__init__.py b/types/milvus-adapter-service/python/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/types/milvus-adapter-service/python/com/__init__.py b/types/milvus-adapter-service/python/com/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/types/milvus-adapter-service/python/com/milvus/__init__.py b/types/milvus-adapter-service/python/com/milvus/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/types/milvus-adapter-service/python/com/milvus/nats/__init__.py b/types/milvus-adapter-service/python/com/milvus/nats/__init__.py new file mode 100644 index 0000000..adefd8e --- /dev/null +++ b/types/milvus-adapter-service/python/com/milvus/nats/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants'] diff --git a/types/milvus-adapter-service/python/com/milvus/nats/constants.py b/types/milvus-adapter-service/python/com/milvus/nats/constants.py new file mode 100644 index 0000000..bbe41d8 --- /dev/null +++ b/types/milvus-adapter-service/python/com/milvus/nats/constants.py @@ -0,0 +1,14 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +from .ttypes import * diff --git a/types/milvus-adapter-service/python/com/milvus/nats/ttypes.py b/types/milvus-adapter-service/python/com/milvus/nats/ttypes.py new file mode 100644 index 0000000..d91e773 --- /dev/null +++ b/types/milvus-adapter-service/python/com/milvus/nats/ttypes.py @@ -0,0 +1,723 @@ +# +# Autogenerated by Thrift Compiler (0.13.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys + +from thrift.transport import TTransport +all_structs = [] + + +class MilvusSegmentGetRequest(object): + """ + Attributes: + - search + - document_ids + - offset + - limit + - sf + + """ + + + def __init__(self, search=None, document_ids=None, offset=None, limit=None, sf=None,): + self.search = search + self.document_ids = document_ids + self.offset = offset + self.limit = limit + self.sf = sf + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.search = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.document_ids = [] + (_etype3, _size0) = iprot.readListBegin() + for _i4 in range(_size0): + _elem5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.document_ids.append(_elem5) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I16: + self.offset = iprot.readI16() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I16: + self.limit = iprot.readI16() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I16: + self.sf = iprot.readI16() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('MilvusSegmentGetRequest') + if self.search is not None: + oprot.writeFieldBegin('search', TType.STRING, 1) + oprot.writeString(self.search.encode('utf-8') if sys.version_info[0] == 2 else self.search) + oprot.writeFieldEnd() + if self.document_ids is not None: + oprot.writeFieldBegin('document_ids', TType.LIST, 2) + oprot.writeListBegin(TType.STRING, len(self.document_ids)) + for iter6 in self.document_ids: + oprot.writeString(iter6.encode('utf-8') if sys.version_info[0] == 2 else iter6) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.offset is not None: + oprot.writeFieldBegin('offset', TType.I16, 3) + oprot.writeI16(self.offset) + oprot.writeFieldEnd() + if self.limit is not None: + oprot.writeFieldBegin('limit', TType.I16, 4) + oprot.writeI16(self.limit) + oprot.writeFieldEnd() + if self.sf is not None: + oprot.writeFieldBegin('sf', TType.I16, 5) + oprot.writeI16(self.sf) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class MilvusSegmentUpsertPayload(object): + """ + Attributes: + - segment_text + - document_id + - section_id + - segment_id + + """ + + + def __init__(self, segment_text=None, document_id=None, section_id=None, segment_id=None,): + self.segment_text = segment_text + self.document_id = document_id + self.section_id = section_id + self.segment_id = segment_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.segment_text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.document_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.section_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.segment_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('MilvusSegmentUpsertPayload') + if self.segment_text is not None: + oprot.writeFieldBegin('segment_text', TType.STRING, 1) + oprot.writeString(self.segment_text.encode('utf-8') if sys.version_info[0] == 2 else self.segment_text) + oprot.writeFieldEnd() + if self.document_id is not None: + oprot.writeFieldBegin('document_id', TType.STRING, 2) + oprot.writeString(self.document_id.encode('utf-8') if sys.version_info[0] == 2 else self.document_id) + oprot.writeFieldEnd() + if self.section_id is not None: + oprot.writeFieldBegin('section_id', TType.STRING, 3) + oprot.writeString(self.section_id.encode('utf-8') if sys.version_info[0] == 2 else self.section_id) + oprot.writeFieldEnd() + if self.segment_id is not None: + oprot.writeFieldBegin('segment_id', TType.STRING, 4) + oprot.writeString(self.segment_id.encode('utf-8') if sys.version_info[0] == 2 else self.segment_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class MilvusSegmentDeletePayload(object): + """ + Attributes: + - document_id + - section_id + - segment_id + + """ + + + def __init__(self, document_id=None, section_id=None, segment_id=None,): + self.document_id = document_id + self.section_id = section_id + self.segment_id = segment_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 2: + if ftype == TType.STRING: + self.document_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.section_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.segment_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('MilvusSegmentDeletePayload') + if self.document_id is not None: + oprot.writeFieldBegin('document_id', TType.STRING, 2) + oprot.writeString(self.document_id.encode('utf-8') if sys.version_info[0] == 2 else self.document_id) + oprot.writeFieldEnd() + if self.section_id is not None: + oprot.writeFieldBegin('section_id', TType.STRING, 3) + oprot.writeString(self.section_id.encode('utf-8') if sys.version_info[0] == 2 else self.section_id) + oprot.writeFieldEnd() + if self.segment_id is not None: + oprot.writeFieldBegin('segment_id', TType.STRING, 4) + oprot.writeString(self.segment_id.encode('utf-8') if sys.version_info[0] == 2 else self.segment_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class L2SegmentSearchResult(object): + """ + Attributes: + - distance + - document_id + - section_id + - segment_id + + """ + + + def __init__(self, distance=None, document_id=None, section_id=None, segment_id=None,): + self.distance = distance + self.document_id = document_id + self.section_id = section_id + self.segment_id = segment_id + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.DOUBLE: + self.distance = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.document_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.section_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.segment_id = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('L2SegmentSearchResult') + if self.distance is not None: + oprot.writeFieldBegin('distance', TType.DOUBLE, 1) + oprot.writeDouble(self.distance) + oprot.writeFieldEnd() + if self.document_id is not None: + oprot.writeFieldBegin('document_id', TType.STRING, 2) + oprot.writeString(self.document_id.encode('utf-8') if sys.version_info[0] == 2 else self.document_id) + oprot.writeFieldEnd() + if self.section_id is not None: + oprot.writeFieldBegin('section_id', TType.STRING, 3) + oprot.writeString(self.section_id.encode('utf-8') if sys.version_info[0] == 2 else self.section_id) + oprot.writeFieldEnd() + if self.segment_id is not None: + oprot.writeFieldBegin('segment_id', TType.STRING, 4) + oprot.writeString(self.segment_id.encode('utf-8') if sys.version_info[0] == 2 else self.segment_id) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class L2SegmentSearchResponse(object): + """ + Attributes: + - results + - total + - is_error + - error_text + + """ + + + def __init__(self, results=None, total=None, is_error=None, error_text=None,): + self.results = results + self.total = total + self.is_error = is_error + self.error_text = error_text + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.LIST: + self.results = [] + (_etype10, _size7) = iprot.readListBegin() + for _i11 in range(_size7): + _elem12 = L2SegmentSearchResult() + _elem12.read(iprot) + self.results.append(_elem12) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.total = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.is_error = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.error_text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('L2SegmentSearchResponse') + if self.results is not None: + oprot.writeFieldBegin('results', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.results)) + for iter13 in self.results: + iter13.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.total is not None: + oprot.writeFieldBegin('total', TType.I32, 2) + oprot.writeI32(self.total) + oprot.writeFieldEnd() + if self.is_error is not None: + oprot.writeFieldBegin('is_error', TType.BOOL, 3) + oprot.writeBool(self.is_error) + oprot.writeFieldEnd() + if self.error_text is not None: + oprot.writeFieldBegin('error_text', TType.STRING, 4) + oprot.writeString(self.error_text.encode('utf-8') if sys.version_info[0] == 2 else self.error_text) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class L2SegmentUpsertResponse(object): + """ + Attributes: + - insert_count + - update_count + - delete_count + - is_error + - error_text + + """ + + + def __init__(self, insert_count=None, update_count=None, delete_count=None, is_error=None, error_text=None,): + self.insert_count = insert_count + self.update_count = update_count + self.delete_count = delete_count + self.is_error = is_error + self.error_text = error_text + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.insert_count = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.update_count = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.delete_count = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.BOOL: + self.is_error = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.error_text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('L2SegmentUpsertResponse') + if self.insert_count is not None: + oprot.writeFieldBegin('insert_count', TType.I32, 1) + oprot.writeI32(self.insert_count) + oprot.writeFieldEnd() + if self.update_count is not None: + oprot.writeFieldBegin('update_count', TType.I32, 2) + oprot.writeI32(self.update_count) + oprot.writeFieldEnd() + if self.delete_count is not None: + oprot.writeFieldBegin('delete_count', TType.I32, 3) + oprot.writeI32(self.delete_count) + oprot.writeFieldEnd() + if self.is_error is not None: + oprot.writeFieldBegin('is_error', TType.BOOL, 4) + oprot.writeBool(self.is_error) + oprot.writeFieldEnd() + if self.error_text is not None: + oprot.writeFieldBegin('error_text', TType.STRING, 5) + oprot.writeString(self.error_text.encode('utf-8') if sys.version_info[0] == 2 else self.error_text) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + +class L2SegmentDeleteResponse(object): + """ + Attributes: + - delete_count + - is_error + - error_text + + """ + + + def __init__(self, delete_count=None, is_error=None, error_text=None,): + self.delete_count = delete_count + self.is_error = is_error + self.error_text = error_text + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.I32: + self.delete_count = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.is_error = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.error_text = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('L2SegmentDeleteResponse') + if self.delete_count is not None: + oprot.writeFieldBegin('delete_count', TType.I32, 1) + oprot.writeI32(self.delete_count) + oprot.writeFieldEnd() + if self.is_error is not None: + oprot.writeFieldBegin('is_error', TType.BOOL, 3) + oprot.writeBool(self.is_error) + oprot.writeFieldEnd() + if self.error_text is not None: + oprot.writeFieldBegin('error_text', TType.STRING, 4) + oprot.writeString(self.error_text.encode('utf-8') if sys.version_info[0] == 2 else self.error_text) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) +all_structs.append(MilvusSegmentGetRequest) +MilvusSegmentGetRequest.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'search', 'UTF8', None, ), # 1 + (2, TType.LIST, 'document_ids', (TType.STRING, 'UTF8', False), None, ), # 2 + (3, TType.I16, 'offset', None, None, ), # 3 + (4, TType.I16, 'limit', None, None, ), # 4 + (5, TType.I16, 'sf', None, None, ), # 5 +) +all_structs.append(MilvusSegmentUpsertPayload) +MilvusSegmentUpsertPayload.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'segment_text', 'UTF8', None, ), # 1 + (2, TType.STRING, 'document_id', 'UTF8', None, ), # 2 + (3, TType.STRING, 'section_id', 'UTF8', None, ), # 3 + (4, TType.STRING, 'segment_id', 'UTF8', None, ), # 4 +) +all_structs.append(MilvusSegmentDeletePayload) +MilvusSegmentDeletePayload.thrift_spec = ( + None, # 0 + None, # 1 + (2, TType.STRING, 'document_id', 'UTF8', None, ), # 2 + (3, TType.STRING, 'section_id', 'UTF8', None, ), # 3 + (4, TType.STRING, 'segment_id', 'UTF8', None, ), # 4 +) +all_structs.append(L2SegmentSearchResult) +L2SegmentSearchResult.thrift_spec = ( + None, # 0 + (1, TType.DOUBLE, 'distance', None, None, ), # 1 + (2, TType.STRING, 'document_id', 'UTF8', None, ), # 2 + (3, TType.STRING, 'section_id', 'UTF8', None, ), # 3 + (4, TType.STRING, 'segment_id', 'UTF8', None, ), # 4 +) +all_structs.append(L2SegmentSearchResponse) +L2SegmentSearchResponse.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'results', (TType.STRUCT, [L2SegmentSearchResult, None], False), None, ), # 1 + (2, TType.I32, 'total', None, None, ), # 2 + (3, TType.BOOL, 'is_error', None, None, ), # 3 + (4, TType.STRING, 'error_text', 'UTF8', None, ), # 4 +) +all_structs.append(L2SegmentUpsertResponse) +L2SegmentUpsertResponse.thrift_spec = ( + None, # 0 + (1, TType.I32, 'insert_count', None, None, ), # 1 + (2, TType.I32, 'update_count', None, None, ), # 2 + (3, TType.I32, 'delete_count', None, None, ), # 3 + (4, TType.BOOL, 'is_error', None, None, ), # 4 + (5, TType.STRING, 'error_text', 'UTF8', None, ), # 5 +) +all_structs.append(L2SegmentDeleteResponse) +L2SegmentDeleteResponse.thrift_spec = ( + None, # 0 + (1, TType.I32, 'delete_count', None, None, ), # 1 + None, # 2 + (3, TType.BOOL, 'is_error', None, None, ), # 3 + (4, TType.STRING, 'error_text', 'UTF8', None, ), # 4 +) +fix_spec(all_structs) +del all_structs diff --git a/types/milvus-adapter-service/thrift/com.milvus.nats.thrift b/types/milvus-adapter-service/thrift/com.milvus.nats.thrift new file mode 100644 index 0000000..6c46fea --- /dev/null +++ b/types/milvus-adapter-service/thrift/com.milvus.nats.thrift @@ -0,0 +1,50 @@ +struct MilvusSegmentGetRequest { + 1: string search; // Search text to find similar items for + 2: optional list document_ids, // List of document IDs (plays partition role) + 3: optional i16 offset; // how many responses to skip + 4: optional i16 limit; // how many responses to return + 5: optional i16 sf; // Search factor ( rf or nprobe depending on the index ) +} + +struct MilvusSegmentUpsertPayload { + 1: string segment_text; // Text to vectorize and save + 2: string document_id; // Id of the document ( plays partition role ) + 3: string section_id; // Id of the section + 4: string segment_id; // Id of the segment +} + +struct MilvusSegmentDeletePayload { + 2: string document_id; // Id of the document ( plays partition role ) + 3: string section_id; // Id of the section + 4: string segment_id; // Id of the segment +} + + +struct L2SegmentSearchResult { + 1: double distance, // Distance value + 2: string document_id, // document_id of the result + 3: string section_id, // section_id of the result + 4: string segment_id // segment_id of the result +} + +struct L2SegmentSearchResponse { + 1: list results, // List of results + 2: i32 total // Results count + 3: bool is_error // Is error or not + 4: optional string error_text // Error message text +} + +struct L2SegmentUpsertResponse { + 1: i32 insert_count // Inserted segments + 2: i32 update_count // Updated segments + 3: i32 delete_count // Deleted segments + 4: bool is_error // Is error or not + 5: optional string error_text // Error message text +} + +struct L2SegmentDeleteResponse { + 1: i32 delete_count // Deleted segments + 3: bool is_error // Is error or not + 4: optional string error_text // Error message text +} + diff --git a/types/milvus-adapter-service/typescript/com.milvus.nats_types.d.ts b/types/milvus-adapter-service/typescript/com.milvus.nats_types.d.ts new file mode 100644 index 0000000..fd5f313 --- /dev/null +++ b/types/milvus-adapter-service/typescript/com.milvus.nats_types.d.ts @@ -0,0 +1,70 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +import Int64 = require('node-int64'); + + +export declare class MilvusSegmentGetRequest { + search: string; + document_ids: string[]; + offset: number; + limit: number; + sf: number; + + constructor(args?: { search: string; document_ids?: string[]; offset?: number; limit?: number; sf?: number; }); +} + +export declare class MilvusSegmentUpsertPayload { + segment_text: string; + document_id: string; + section_id: string; + segment_id: string; + + constructor(args?: { segment_text: string; document_id: string; section_id: string; segment_id: string; }); +} + +export declare class MilvusSegmentDeletePayload { + document_id: string; + section_id: string; + segment_id: string; + + constructor(args?: { document_id: string; section_id: string; segment_id: string; }); +} + +export declare class L2SegmentSearchResult { + distance: number; + document_id: string; + section_id: string; + segment_id: string; + + constructor(args?: { distance: number; document_id: string; section_id: string; segment_id: string; }); +} + +export declare class L2SegmentSearchResponse { + results: L2SegmentSearchResult[]; + total: number; + is_error: boolean; + error_text: string; + + constructor(args?: { results: L2SegmentSearchResult[]; total: number; is_error: boolean; error_text?: string; }); +} + +export declare class L2SegmentUpsertResponse { + insert_count: number; + update_count: number; + delete_count: number; + is_error: boolean; + error_text: string; + + constructor(args?: { insert_count: number; update_count: number; delete_count: number; is_error: boolean; error_text?: string; }); +} + +export declare class L2SegmentDeleteResponse { + delete_count: number; + is_error: boolean; + error_text: string; + + constructor(args?: { delete_count: number; is_error: boolean; error_text?: string; }); +} diff --git a/types/milvus-adapter-service/typescript/com.milvus.nats_types.js b/types/milvus-adapter-service/typescript/com.milvus.nats_types.js new file mode 100644 index 0000000..c3fbd33 --- /dev/null +++ b/types/milvus-adapter-service/typescript/com.milvus.nats_types.js @@ -0,0 +1,706 @@ +// +// Autogenerated by Thrift Compiler (0.13.0) +// +// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// +if (typeof Int64 === 'undefined' && typeof require === 'function') { + var Int64 = require('node-int64'); +} + + +MilvusSegmentGetRequest = function(args) { + this.search = null; + this.document_ids = null; + this.offset = null; + this.limit = null; + this.sf = null; + if (args) { + if (args.search !== undefined && args.search !== null) { + this.search = args.search; + } + if (args.document_ids !== undefined && args.document_ids !== null) { + this.document_ids = Thrift.copyList(args.document_ids, [null]); + } + if (args.offset !== undefined && args.offset !== null) { + this.offset = args.offset; + } + if (args.limit !== undefined && args.limit !== null) { + this.limit = args.limit; + } + if (args.sf !== undefined && args.sf !== null) { + this.sf = args.sf; + } + } +}; +MilvusSegmentGetRequest.prototype = {}; +MilvusSegmentGetRequest.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.search = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.LIST) { + this.document_ids = []; + var _rtmp31 = input.readListBegin(); + var _size0 = _rtmp31.size || 0; + for (var _i2 = 0; _i2 < _size0; ++_i2) { + var elem3 = null; + elem3 = input.readString().value; + this.document_ids.push(elem3); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I16) { + this.offset = input.readI16().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.I16) { + this.limit = input.readI16().value; + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.I16) { + this.sf = input.readI16().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +MilvusSegmentGetRequest.prototype.write = function(output) { + output.writeStructBegin('MilvusSegmentGetRequest'); + if (this.search !== null && this.search !== undefined) { + output.writeFieldBegin('search', Thrift.Type.STRING, 1); + output.writeString(this.search); + output.writeFieldEnd(); + } + if (this.document_ids !== null && this.document_ids !== undefined) { + output.writeFieldBegin('document_ids', Thrift.Type.LIST, 2); + output.writeListBegin(Thrift.Type.STRING, this.document_ids.length); + for (var iter4 in this.document_ids) { + if (this.document_ids.hasOwnProperty(iter4)) { + iter4 = this.document_ids[iter4]; + output.writeString(iter4); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.offset !== null && this.offset !== undefined) { + output.writeFieldBegin('offset', Thrift.Type.I16, 3); + output.writeI16(this.offset); + output.writeFieldEnd(); + } + if (this.limit !== null && this.limit !== undefined) { + output.writeFieldBegin('limit', Thrift.Type.I16, 4); + output.writeI16(this.limit); + output.writeFieldEnd(); + } + if (this.sf !== null && this.sf !== undefined) { + output.writeFieldBegin('sf', Thrift.Type.I16, 5); + output.writeI16(this.sf); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +MilvusSegmentUpsertPayload = function(args) { + this.segment_text = null; + this.document_id = null; + this.section_id = null; + this.segment_id = null; + if (args) { + if (args.segment_text !== undefined && args.segment_text !== null) { + this.segment_text = args.segment_text; + } + if (args.document_id !== undefined && args.document_id !== null) { + this.document_id = args.document_id; + } + if (args.section_id !== undefined && args.section_id !== null) { + this.section_id = args.section_id; + } + if (args.segment_id !== undefined && args.segment_id !== null) { + this.segment_id = args.segment_id; + } + } +}; +MilvusSegmentUpsertPayload.prototype = {}; +MilvusSegmentUpsertPayload.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.STRING) { + this.segment_text = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.document_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.section_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.segment_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +MilvusSegmentUpsertPayload.prototype.write = function(output) { + output.writeStructBegin('MilvusSegmentUpsertPayload'); + if (this.segment_text !== null && this.segment_text !== undefined) { + output.writeFieldBegin('segment_text', Thrift.Type.STRING, 1); + output.writeString(this.segment_text); + output.writeFieldEnd(); + } + if (this.document_id !== null && this.document_id !== undefined) { + output.writeFieldBegin('document_id', Thrift.Type.STRING, 2); + output.writeString(this.document_id); + output.writeFieldEnd(); + } + if (this.section_id !== null && this.section_id !== undefined) { + output.writeFieldBegin('section_id', Thrift.Type.STRING, 3); + output.writeString(this.section_id); + output.writeFieldEnd(); + } + if (this.segment_id !== null && this.segment_id !== undefined) { + output.writeFieldBegin('segment_id', Thrift.Type.STRING, 4); + output.writeString(this.segment_id); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +MilvusSegmentDeletePayload = function(args) { + this.document_id = null; + this.section_id = null; + this.segment_id = null; + if (args) { + if (args.document_id !== undefined && args.document_id !== null) { + this.document_id = args.document_id; + } + if (args.section_id !== undefined && args.section_id !== null) { + this.section_id = args.section_id; + } + if (args.segment_id !== undefined && args.segment_id !== null) { + this.segment_id = args.segment_id; + } + } +}; +MilvusSegmentDeletePayload.prototype = {}; +MilvusSegmentDeletePayload.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 2: + if (ftype == Thrift.Type.STRING) { + this.document_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.section_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.segment_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +MilvusSegmentDeletePayload.prototype.write = function(output) { + output.writeStructBegin('MilvusSegmentDeletePayload'); + if (this.document_id !== null && this.document_id !== undefined) { + output.writeFieldBegin('document_id', Thrift.Type.STRING, 2); + output.writeString(this.document_id); + output.writeFieldEnd(); + } + if (this.section_id !== null && this.section_id !== undefined) { + output.writeFieldBegin('section_id', Thrift.Type.STRING, 3); + output.writeString(this.section_id); + output.writeFieldEnd(); + } + if (this.segment_id !== null && this.segment_id !== undefined) { + output.writeFieldBegin('segment_id', Thrift.Type.STRING, 4); + output.writeString(this.segment_id); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +L2SegmentSearchResult = function(args) { + this.distance = null; + this.document_id = null; + this.section_id = null; + this.segment_id = null; + if (args) { + if (args.distance !== undefined && args.distance !== null) { + this.distance = args.distance; + } + if (args.document_id !== undefined && args.document_id !== null) { + this.document_id = args.document_id; + } + if (args.section_id !== undefined && args.section_id !== null) { + this.section_id = args.section_id; + } + if (args.segment_id !== undefined && args.segment_id !== null) { + this.segment_id = args.segment_id; + } + } +}; +L2SegmentSearchResult.prototype = {}; +L2SegmentSearchResult.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.DOUBLE) { + this.distance = input.readDouble().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.STRING) { + this.document_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.STRING) { + this.section_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.segment_id = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +L2SegmentSearchResult.prototype.write = function(output) { + output.writeStructBegin('L2SegmentSearchResult'); + if (this.distance !== null && this.distance !== undefined) { + output.writeFieldBegin('distance', Thrift.Type.DOUBLE, 1); + output.writeDouble(this.distance); + output.writeFieldEnd(); + } + if (this.document_id !== null && this.document_id !== undefined) { + output.writeFieldBegin('document_id', Thrift.Type.STRING, 2); + output.writeString(this.document_id); + output.writeFieldEnd(); + } + if (this.section_id !== null && this.section_id !== undefined) { + output.writeFieldBegin('section_id', Thrift.Type.STRING, 3); + output.writeString(this.section_id); + output.writeFieldEnd(); + } + if (this.segment_id !== null && this.segment_id !== undefined) { + output.writeFieldBegin('segment_id', Thrift.Type.STRING, 4); + output.writeString(this.segment_id); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +L2SegmentSearchResponse = function(args) { + this.results = null; + this.total = null; + this.is_error = null; + this.error_text = null; + if (args) { + if (args.results !== undefined && args.results !== null) { + this.results = Thrift.copyList(args.results, [L2SegmentSearchResult]); + } + if (args.total !== undefined && args.total !== null) { + this.total = args.total; + } + if (args.is_error !== undefined && args.is_error !== null) { + this.is_error = args.is_error; + } + if (args.error_text !== undefined && args.error_text !== null) { + this.error_text = args.error_text; + } + } +}; +L2SegmentSearchResponse.prototype = {}; +L2SegmentSearchResponse.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.LIST) { + this.results = []; + var _rtmp36 = input.readListBegin(); + var _size5 = _rtmp36.size || 0; + for (var _i7 = 0; _i7 < _size5; ++_i7) { + var elem8 = null; + elem8 = new L2SegmentSearchResult(); + elem8.read(input); + this.results.push(elem8); + } + input.readListEnd(); + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.total = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.is_error = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.error_text = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +L2SegmentSearchResponse.prototype.write = function(output) { + output.writeStructBegin('L2SegmentSearchResponse'); + if (this.results !== null && this.results !== undefined) { + output.writeFieldBegin('results', Thrift.Type.LIST, 1); + output.writeListBegin(Thrift.Type.STRUCT, this.results.length); + for (var iter9 in this.results) { + if (this.results.hasOwnProperty(iter9)) { + iter9 = this.results[iter9]; + iter9.write(output); + } + } + output.writeListEnd(); + output.writeFieldEnd(); + } + if (this.total !== null && this.total !== undefined) { + output.writeFieldBegin('total', Thrift.Type.I32, 2); + output.writeI32(this.total); + output.writeFieldEnd(); + } + if (this.is_error !== null && this.is_error !== undefined) { + output.writeFieldBegin('is_error', Thrift.Type.BOOL, 3); + output.writeBool(this.is_error); + output.writeFieldEnd(); + } + if (this.error_text !== null && this.error_text !== undefined) { + output.writeFieldBegin('error_text', Thrift.Type.STRING, 4); + output.writeString(this.error_text); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +L2SegmentUpsertResponse = function(args) { + this.insert_count = null; + this.update_count = null; + this.delete_count = null; + this.is_error = null; + this.error_text = null; + if (args) { + if (args.insert_count !== undefined && args.insert_count !== null) { + this.insert_count = args.insert_count; + } + if (args.update_count !== undefined && args.update_count !== null) { + this.update_count = args.update_count; + } + if (args.delete_count !== undefined && args.delete_count !== null) { + this.delete_count = args.delete_count; + } + if (args.is_error !== undefined && args.is_error !== null) { + this.is_error = args.is_error; + } + if (args.error_text !== undefined && args.error_text !== null) { + this.error_text = args.error_text; + } + } +}; +L2SegmentUpsertResponse.prototype = {}; +L2SegmentUpsertResponse.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.insert_count = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 2: + if (ftype == Thrift.Type.I32) { + this.update_count = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.I32) { + this.delete_count = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.BOOL) { + this.is_error = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 5: + if (ftype == Thrift.Type.STRING) { + this.error_text = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +L2SegmentUpsertResponse.prototype.write = function(output) { + output.writeStructBegin('L2SegmentUpsertResponse'); + if (this.insert_count !== null && this.insert_count !== undefined) { + output.writeFieldBegin('insert_count', Thrift.Type.I32, 1); + output.writeI32(this.insert_count); + output.writeFieldEnd(); + } + if (this.update_count !== null && this.update_count !== undefined) { + output.writeFieldBegin('update_count', Thrift.Type.I32, 2); + output.writeI32(this.update_count); + output.writeFieldEnd(); + } + if (this.delete_count !== null && this.delete_count !== undefined) { + output.writeFieldBegin('delete_count', Thrift.Type.I32, 3); + output.writeI32(this.delete_count); + output.writeFieldEnd(); + } + if (this.is_error !== null && this.is_error !== undefined) { + output.writeFieldBegin('is_error', Thrift.Type.BOOL, 4); + output.writeBool(this.is_error); + output.writeFieldEnd(); + } + if (this.error_text !== null && this.error_text !== undefined) { + output.writeFieldBegin('error_text', Thrift.Type.STRING, 5); + output.writeString(this.error_text); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; + +L2SegmentDeleteResponse = function(args) { + this.delete_count = null; + this.is_error = null; + this.error_text = null; + if (args) { + if (args.delete_count !== undefined && args.delete_count !== null) { + this.delete_count = args.delete_count; + } + if (args.is_error !== undefined && args.is_error !== null) { + this.is_error = args.is_error; + } + if (args.error_text !== undefined && args.error_text !== null) { + this.error_text = args.error_text; + } + } +}; +L2SegmentDeleteResponse.prototype = {}; +L2SegmentDeleteResponse.prototype.read = function(input) { + input.readStructBegin(); + while (true) { + var ret = input.readFieldBegin(); + var ftype = ret.ftype; + var fid = ret.fid; + if (ftype == Thrift.Type.STOP) { + break; + } + switch (fid) { + case 1: + if (ftype == Thrift.Type.I32) { + this.delete_count = input.readI32().value; + } else { + input.skip(ftype); + } + break; + case 3: + if (ftype == Thrift.Type.BOOL) { + this.is_error = input.readBool().value; + } else { + input.skip(ftype); + } + break; + case 4: + if (ftype == Thrift.Type.STRING) { + this.error_text = input.readString().value; + } else { + input.skip(ftype); + } + break; + default: + input.skip(ftype); + } + input.readFieldEnd(); + } + input.readStructEnd(); + return; +}; + +L2SegmentDeleteResponse.prototype.write = function(output) { + output.writeStructBegin('L2SegmentDeleteResponse'); + if (this.delete_count !== null && this.delete_count !== undefined) { + output.writeFieldBegin('delete_count', Thrift.Type.I32, 1); + output.writeI32(this.delete_count); + output.writeFieldEnd(); + } + if (this.is_error !== null && this.is_error !== undefined) { + output.writeFieldBegin('is_error', Thrift.Type.BOOL, 3); + output.writeBool(this.is_error); + output.writeFieldEnd(); + } + if (this.error_text !== null && this.error_text !== undefined) { + output.writeFieldBegin('error_text', Thrift.Type.STRING, 4); + output.writeString(this.error_text); + output.writeFieldEnd(); + } + output.writeFieldStop(); + output.writeStructEnd(); + return; +}; +