Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to use remoteknowledgesource, add notion and website #106

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions apiclient/types/knowledge.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package types

type KnowledgeFile struct {
Metadata
FileName string `json:"fileName"`
AgentID string `json:"agentID,omitempty"`
WorkflowID string `json:"workflowID,omitempty"`
ThreadID string `json:"threadID,omitempty"`
UploadID string `json:"uploadID,omitempty"`
IngestionStatus IngestionStatus `json:"ingestionStatus,omitempty"`
FileDetails FileDetails `json:"fileDetails,omitempty"`
FileName string `json:"fileName"`
AgentID string `json:"agentID,omitempty"`
WorkflowID string `json:"workflowID,omitempty"`
ThreadID string `json:"threadID,omitempty"`
RemoteKnowledgeSourceID string `json:"remoteKnowledgeSourceID,omitempty"`
RemoteKnowledgeSourceType RemoteKnowledgeSourceType `json:"remoteKnowledgeSourceType,omitempty"`
IngestionStatus IngestionStatus `json:"ingestionStatus,omitempty"`
FileDetails FileDetails `json:"fileDetails,omitempty"`
}

type FileDetails struct {
Expand Down
15 changes: 0 additions & 15 deletions apiclient/types/onedrive.go

This file was deleted.

67 changes: 67 additions & 0 deletions apiclient/types/remoteKnowledgeSource.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package types

var (
RemoteKnowledgeSourceTypeOneDrive RemoteKnowledgeSourceType = "onedrive"
RemoteKnowledgeSourceTypeNotion RemoteKnowledgeSourceType = "notion"
RemoteKnowledgeSourceTypeWebsite RemoteKnowledgeSourceType = "website"
)

type RemoteKnowledgeSourceType string

type RemoteKnowledgeSource struct {
Metadata
AgentID string `json:"agentID,omitempty"`
WorkflowID string `json:"workflowID,omitempty"`
ThreadID string `json:"threadID,omitempty"`
RunID string `json:"runID,omitempty"`
Input RemoteKnowledgeSourceInput `json:"input,omitempty"`
State RemoteKnowledgeSourceState `json:"state,omitempty"`
Status string `json:"status,omitempty"`
Error string `json:"error,omitempty"`
}

type RemoteKnowledgeSourceList List[RemoteKnowledgeSource]

type RemoteKnowledgeSourceInput struct {
SourceType RemoteKnowledgeSourceType `json:"sourceType,omitempty"`
Exclude []string `json:"exclude,omitempty"`
OneDriveConfig *OneDriveConfig `json:"onedriveConfig,omitempty"`
NotionConfig *NotionConfig `json:"notionConfig,omitempty"`
WebsiteCrawlingConfig *WebsiteCrawlingConfig `json:"websiteCrawlingConfig,omitempty"`
}

type OneDriveConfig struct {
SharedLinks []string `json:"sharedLinks,omitempty"`
}

type NotionConfig struct {
Pages []string `json:"pages,omitempty"`
}

type WebsiteCrawlingConfig struct {
URLs []string `json:"urls,omitempty"`
}

type RemoteKnowledgeSourceState struct {
OneDriveState *OneDriveLinksConnectorState `json:"onedriveState,omitempty"`
NotionState *NotionConnectorState `json:"notionState,omitempty"`
WebsiteCrawlingState *WebsiteCrawlingConnectorState `json:"websiteCrawlingState,omitempty"`
}

type OneDriveLinksConnectorState struct {
Folders FolderSet `json:"folders,omitempty"`
}

type NotionConnectorState struct {
Pages map[string]NotionPage `json:"pages,omitempty"`
}

type NotionPage struct {
URL string `json:"url,omitempty"`
Title string `json:"title,omitempty"`
}

type WebsiteCrawlingConnectorState struct {
ScrapeJobIds map[string]string `json:"scrapeJobIds"`
Folders FolderSet `json:"folders"`
}
241 changes: 222 additions & 19 deletions apiclient/types/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading