Documentation ¶
Index ¶
- Constants
- func NormalizeMessages(msgs []*goopenai.ChatCompletionMessage, defaultUserMessage string) (ret []*goopenai.ChatCompletionMessage)
- func ReturnItem(item string) string
- type Attachment
- type ChatOptions
- type ChatRequest
- type GroupItems
- type GroupsItemsSelector
- func (o *GroupsItemsSelector[I]) AddGroupItems(group string, items ...I)
- func (o *GroupsItemsSelector[I]) FindGroupsByItem(item I) (groups []string)
- func (o *GroupsItemsSelector[I]) FindGroupsByItemFirst(item I) (ret string)
- func (o *GroupsItemsSelector[I]) GetGroupAndItemByItemNumber(number int) (group string, item I, err error)
- func (o *GroupsItemsSelector[I]) HasGroup(group string) (ret bool)
- func (o *GroupsItemsSelector[I]) Print()
- type GroupsItemsSelectorString
Constants ¶
View Source
const ChatMessageRoleMeta = "meta"
Variables ¶
This section is empty.
Functions ¶
func NormalizeMessages ¶
func NormalizeMessages(msgs []*goopenai.ChatCompletionMessage, defaultUserMessage string) (ret []*goopenai.ChatCompletionMessage)
NormalizeMessages remove empty messages and ensure messages order user-assist-user
func ReturnItem ¶ added in v1.4.67
Types ¶
type Attachment ¶ added in v1.4.79
type Attachment struct { Type *string `json:"type,omitempty"` Path *string `json:"path,omitempty"` URL *string `json:"url,omitempty"` Content []byte `json:"content,omitempty"` ID *string `json:"id,omitempty"` }
func NewAttachment ¶ added in v1.4.79
func NewAttachment(value string) (ret *Attachment, err error)
func (*Attachment) Base64Content ¶ added in v1.4.79
func (a *Attachment) Base64Content() (ret string, err error)
func (*Attachment) ContentBytes ¶ added in v1.4.79
func (a *Attachment) ContentBytes() (ret []byte, err error)
func (*Attachment) GetId ¶ added in v1.4.79
func (a *Attachment) GetId() (ret string, err error)
func (*Attachment) ResolveType ¶ added in v1.4.79
func (a *Attachment) ResolveType() (ret string, err error)
type ChatOptions ¶
type ChatRequest ¶
type GroupItems ¶ added in v1.4.67
func (*GroupItems[I]) ContainsItemBy ¶ added in v1.4.67
func (o *GroupItems[I]) ContainsItemBy(predicate func(item I) bool) (ret bool)
func (*GroupItems[I]) Count ¶ added in v1.4.67
func (o *GroupItems[I]) Count() int
type GroupsItemsSelector ¶ added in v1.4.67
type GroupsItemsSelector[I any] struct { SelectionLabel string GetItemKey func(I) string GroupsItems []*GroupItems[I] }
func NewGroupsItemsSelector ¶ added in v1.4.67
func NewGroupsItemsSelector[I any](selectionLabel string, getItemLabel func(I) string) *GroupsItemsSelector[I]
func (*GroupsItemsSelector[I]) AddGroupItems ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) AddGroupItems(group string, items ...I)
func (*GroupsItemsSelector[I]) FindGroupsByItem ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) FindGroupsByItem(item I) (groups []string)
func (*GroupsItemsSelector[I]) FindGroupsByItemFirst ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) FindGroupsByItemFirst(item I) (ret string)
func (*GroupsItemsSelector[I]) GetGroupAndItemByItemNumber ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) GetGroupAndItemByItemNumber(number int) (group string, item I, err error)
func (*GroupsItemsSelector[I]) HasGroup ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) HasGroup(group string) (ret bool)
func (*GroupsItemsSelector[I]) Print ¶ added in v1.4.67
func (o *GroupsItemsSelector[I]) Print()
type GroupsItemsSelectorString ¶ added in v1.4.67
type GroupsItemsSelectorString struct { *GroupsItemsSelector[string] }
func NewGroupsItemsSelectorString ¶ added in v1.4.67
func NewGroupsItemsSelectorString(selectionLabel string) *GroupsItemsSelectorString
Click to show internal directories.
Click to hide internal directories.