Documentation ¶
Overview ¶
Package cai
Copyright © 2023 Harmony AI Solutions & Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cai ¶
Copyright © 2023 Harmony AI Solutions & Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cai ¶
Copyright © 2023 Harmony AI Solutions & Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cai ¶
Copyright © 2023 Harmony AI Solutions & Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cai ¶
Copyright © 2023 Harmony AI Solutions & Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cai ¶
Copyright © 2023 Harmony AI Solutions & Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Package cai ¶
Copyright © 2023 Harmony AI Solutions & Contributors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Character
- func (c *Character) Categories() (map[string]interface{}, error)
- func (c *Character) Create(...) (map[string]interface{}, error)
- func (c *Character) Info(char, token string) (map[string]interface{}, error)
- func (c *Character) Recommended(token string) (map[string]interface{}, error)
- func (c *Character) Search(query, token string) (map[string]interface{}, error)
- func (c *Character) Trending() (map[string]interface{}, error)
- func (c *Character) Update(...) (map[string]interface{}, error)
- func (c *Character) Voices() (map[string]interface{}, error)
- type Chat
- func (c *Chat) CreateRoom(characters []string, name, topic string, extraArgs map[string]interface{}) (map[string]interface{}, error)
- func (c *Chat) DeleteMessage(historyID string, uuidsToDelete []string, extraArgs map[string]interface{}) (map[string]interface{}, error)
- func (c *Chat) GetChat(char string) (*ChatData, error)
- func (c *Chat) GetHistories(char string, number int) (map[string]interface{}, error)
- func (c *Chat) GetHistory(historyID string) (*ChatHistory, error)
- func (c *Chat) NewChat(char string) (*ChatData, error)
- func (c *Chat) NextMessage(historyID, parentMsgUUID, tgt string, extraArgs map[string]interface{}) (map[string]interface{}, error)
- func (c *Chat) Rate(rate int, historyID, messageID string, extraArgs map[string]interface{}) (map[string]interface{}, error)
- func (c *Chat) SendMessage(historyID, tgt, text string, extraArgs map[string]interface{}) (*ChatMessage, error)
- type Chat2
- func (c *Chat2) DeleteMessage(chatID string, turnIDs []string) (map[string]interface{}, error)
- func (c *Chat2) GetChat(char string) (map[string]interface{}, error)
- func (c *Chat2) GetHistories(char string, preview int) (map[string]interface{}, error)
- func (c *Chat2) GetHistory(chatID string) (map[string]interface{}, error)
- func (c *Chat2) NewChat(char, chatID, creatorID string, withGreeting ...bool) (map[string]interface{}, map[string]interface{}, error)
- func (c *Chat2) NextMessage(char, chatID, parentMsgUUID string) (map[string]interface{}, error)
- func (c *Chat2) Rate(rate int, chatID, turnID, candidateID string) (map[string]interface{}, error)
- func (c *Chat2) SendMessage(char, chatID, text string, author map[string]interface{}, ...) (map[string]interface{}, error)
- type ChatAccount
- type ChatChar
- type ChatData
- type ChatHistory
- type ChatHistoryMessage
- type ChatMessage
- type ChatMessageReply
- type ChatParticipant
- type ChatUser
- type GoCAI
- type Post
- func (p *Post) Create(postType, externalID, title, text, postVisibility string, ...) (map[string]interface{}, error)
- func (p *Post) Delete(postID string) (map[string]interface{}, error)
- func (p *Post) DeleteComment(messageID int, postID string) (map[string]interface{}, error)
- func (p *Post) Feed(topic string, num, load int, sort string) (map[string]interface{}, error)
- func (p *Post) GetPost(postID string) (map[string]interface{}, error)
- func (p *Post) GetPosts(username string, postsPage int, postsToLoad int) (map[string]interface{}, error)
- func (p *Post) GetTopics() (map[string]interface{}, error)
- func (p *Post) My(postsPage int, postsToLoad int) (map[string]interface{}, error)
- func (p *Post) SendComment(postID, text, parentUUID string) (map[string]interface{}, error)
- func (p *Post) UndoUpvote(postExternalID string) (map[string]interface{}, error)
- func (p *Post) Upvote(postExternalID string) (map[string]interface{}, error)
- type Session
- type User
- func (u *User) Characters() (map[string]interface{}, error)
- func (u *User) Followers() (map[string]interface{}, error)
- func (u *User) Following() (map[string]interface{}, error)
- func (u *User) GetProfile(username string) (map[string]interface{}, error)
- func (u *User) Info() (map[string]interface{}, error)
- func (u *User) Recent() (map[string]interface{}, error)
- func (u *User) Update(username string, data map[string]interface{}) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Character ¶
func (*Character) Categories ¶
func (*Character) Recommended ¶
type Chat ¶
func (*Chat) CreateRoom ¶
func (*Chat) DeleteMessage ¶
func (*Chat) GetHistories ¶
func (*Chat) GetHistory ¶
func (c *Chat) GetHistory(historyID string) (*ChatHistory, error)
func (*Chat) NextMessage ¶
func (*Chat) SendMessage ¶
func (c *Chat) SendMessage(historyID, tgt, text string, extraArgs map[string]interface{}) (*ChatMessage, error)
type Chat2 ¶
func (*Chat2) DeleteMessage ¶
func (*Chat2) GetHistories ¶
func (*Chat2) GetHistory ¶
func (*Chat2) NextMessage ¶
type ChatAccount ¶ added in v0.0.3
type ChatChar ¶ added in v0.0.3
type ChatChar struct { Participant *ChatParticipant `json:"participant"` AvatarFileName *string `json:"avatar_file_name"` }
type ChatHistory ¶ added in v0.0.3
type ChatHistory struct { Messages []*ChatHistoryMessage `json:"messages"` HasMore bool `json:"has_more"` NextPage int `json:"next_page"` }
type ChatHistoryMessage ¶ added in v0.0.3
type ChatHistoryMessage struct { Target string `json:"tgt"` ImageRelPath string `json:"image_rel_path"` ImagePromptText string `json:"image_prompt_text"` Deleted *bool `json:"deleted"` // TODO: confirm bool IsAlternative bool `json:"is_alternative"` SourceName string `json:"src__name"` SourceUserUsername string `json:"src__user__username"` ResponsibleUserUsername *string `json:"responsible_user__username"` ID uint64 `json:"id"` UUID string `json:"uuid"` Source string `json:"src"` SourceIsHuman bool `json:"src__is_human"` SourceCharacterAvatarFileName *string `json:"src__character__avatar_file_name"` SourceChar *ChatChar `json:"src_char"` Text string `json:"text"` }
type ChatMessage ¶ added in v0.0.3
type ChatMessage struct { Replies []*ChatMessageReply `json:"replies"` SourceChar *ChatChar `json:"src_char"` IsFinalChunk bool `json:"is_final_chunk"` LastUserMsgId uint64 `json:"last_user_msg_id"` LastUserMsgUUID string `json:"last_user_msg_uuid"` }
type ChatMessageReply ¶ added in v0.0.3
type ChatParticipant ¶ added in v0.0.3
type ChatUser ¶ added in v0.0.3
type ChatUser struct { Username string `json:"username"` ID uint64 `json:"id"` FirstName string `json:"first_name"` IsStaff bool `json:"is_staff"` Account *ChatAccount `json:"account"` }
type GoCAI ¶
type Post ¶
func (*Post) DeleteComment ¶
func (*Post) SendComment ¶
func (*Post) UndoUpvote ¶
type Session ¶
type Session struct { // Public Attributes URL string Token string // contains filtered or unexported fields }
func NewSession ¶
func NewSession(url, token string, clientIdentifier profiles.ClientProfile) (*Session, error)