curategpt.wrappers.general package

Submodules

curategpt.wrappers.general.filesystem_wrapper module

Chat with a filesystem.

class curategpt.wrappers.general.filesystem_wrapper.FilesystemWrapper(source_locator=None, local_store=None, extractor=None, root_directory=None, glob=None)

Bases: BaseWrapper

A wrapper over a filesystem.

This is a static wrapper: it cannot be searched

glob: str = None
max_text_length = 3000
name: ClassVar[str] = 'filesystem'
objects(collection=None, object_ids=None, **kwargs)

Return all objects in the view.

Parameters:
  • collection (Optional[str])

  • object_ids (Optional[Iterable[str]]) – Optional list of IDs to fetch

  • kwargs

Return type:

Iterator[Dict]

Returns:

root_directory: str = None
search_limit_multiplier: ClassVar[int] = 1
skip_unprocessable = True
text_overlap = 200

curategpt.wrappers.general.github_wrapper module

Chat with issues from a GitHub repository.

class curategpt.wrappers.general.github_wrapper.Comment(**data)

Bases: BaseModel

body: str
id: str
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'body': FieldInfo(annotation=str, required=False, default=None), 'id': FieldInfo(annotation=str, required=True), 'user': FieldInfo(annotation=str, required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

user: str
class curategpt.wrappers.general.github_wrapper.GitHubWrapper(source_locator=None, local_store=None, extractor=None, session=None, owner=None, repo=None, _repo_description=None, **_kwargs)

Bases: BaseWrapper

A wrapper to provide a search facade over GitHub.

This is a dynamic wrapper: it can be used as a search facade, but cannot be ingested in whole.

cache_name: ClassVar[str] = 'github_requests'
default_object_type = 'Issue'

Search an external source and return the results.

Parameters:
  • text (str)

  • kwargs

Return type:

List[Dict]

Returns:

property headers
issue_comments(issue_number)
Return type:

Iterator[Dict]

name: ClassVar[str] = 'github'
objects(collection=None, object_ids=None, token=None, **kwargs)

Return all objects in the view.

Parameters:
  • collection (Optional[str])

  • object_ids (Optional[Iterable[str]]) – Optional list of IDs to fetch

  • kwargs

Return type:

Iterator[Dict]

Returns:

owner: str = None
pr_comments(pr_number)
Return type:

Iterator[Dict]

repo: str = None
property repo_description: str
session: Session = None
transform_issue(obj)
Return type:

Issue

class curategpt.wrappers.general.github_wrapper.Issue(**data)

Bases: BaseModel

assignees: List[str]
body: str
comments: List[Comment]
created_at: str
id: str
labels: List[str]
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'assignees': FieldInfo(annotation=List[str], required=False, default=None), 'body': FieldInfo(annotation=str, required=False, default=None), 'comments': FieldInfo(annotation=List[curategpt.wrappers.general.github_wrapper.Comment], required=False, default=None), 'created_at': FieldInfo(annotation=str, required=False, default=None), 'id': FieldInfo(annotation=str, required=True), 'labels': FieldInfo(annotation=List[str], required=False, default=None), 'number': FieldInfo(annotation=int, required=False, default=None), 'state': FieldInfo(annotation=str, required=False, default=None), 'title': FieldInfo(annotation=str, required=False, default=None), 'type': FieldInfo(annotation=str, required=False, default=None), 'user': FieldInfo(annotation=str, required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

number: int
state: str
title: str
type: str
user: str
class curategpt.wrappers.general.github_wrapper.PullRequest(**data)

Bases: BaseModel

assignees: List[str]
body: str
comments: List[Comment]
created_at: str
id: str
labels: List[str]
model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'protected_namespaces': ()}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[Dict[str, FieldInfo]] = {'assignees': FieldInfo(annotation=List[str], required=False, default=None), 'body': FieldInfo(annotation=str, required=False, default=None), 'comments': FieldInfo(annotation=List[curategpt.wrappers.general.github_wrapper.Comment], required=False, default=None), 'created_at': FieldInfo(annotation=str, required=False, default=None), 'id': FieldInfo(annotation=str, required=True), 'labels': FieldInfo(annotation=List[str], required=False, default=None), 'number': FieldInfo(annotation=int, required=False, default=None), 'state': FieldInfo(annotation=str, required=False, default=None), 'title': FieldInfo(annotation=str, required=False, default=None), 'user': FieldInfo(annotation=str, required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.

This replaces Model.__fields__ from Pydantic V1.

number: int
state: str
title: str
user: str
curategpt.wrappers.general.github_wrapper.get_token(token=None)
Return type:

Optional[str]

curategpt.wrappers.general.github_wrapper.pr_comments(self, pr_number)
Return type:

Iterator[Dict]

curategpt.wrappers.general.google_drive_wrapper module

Chat with a Google Drive.

class curategpt.wrappers.general.google_drive_wrapper.GoogleDriveWrapper(source_locator=None, local_store=None, extractor=None, google_drive_id='0ABiscjZCrxjUUk9PVA', google_folder_id=None, service=None, **_kwargs)

Bases: BaseWrapper

A wrapper to provide a search facade over Wikipedia.

This is a dynamic wrapper: it can be used as a search facade, but cannot be ingested in whole.

default_doc_types = ['application/vnd.google-apps.document']

Search an external source and return the results.

Parameters:
  • text (str)

  • kwargs

Return type:

List[Dict]

Returns:

google_drive_id: str = '0ABiscjZCrxjUUk9PVA'
google_folder_id: str = None
name: ClassVar[str] = 'google_drive'
objects_by_ids(object_ids)

Return objects by their IDs.

Parameters:

object_ids (List[str])

Return type:

List[Dict]

Returns:

objects_from_files(files)
Return type:

List[Dict]

search_limit_multiplier: ClassVar[int] = 1
service: Any = None

curategpt.wrappers.general.gspread_wrapper module

Chat with a Google Drive.

class curategpt.wrappers.general.gspread_wrapper.GSpreadWrapper(source_locator=None, local_store=None, extractor=None, sheet_name=None, worksheet_name=None, service=None, **_kwargs)

Bases: BaseWrapper

A wrapper to provide a search facade over gspread layer onto google sheets.

Currently static, but could be made dynamic in the future.

gc = None
name: ClassVar[str] = 'gspread'
objects(collection=None, object_ids=None, **kwargs)

Return all objects in the view.

Parameters:
  • collection (Optional[str])

  • object_ids (Optional[Iterable[str]]) – Optional list of IDs to fetch

  • kwargs

Return type:

Iterator[Dict]

Returns:

service: Any = None
sheet_name: str = None
worksheet_name: str = None

curategpt.wrappers.general.json_wrapper module

Wrapper for JSON (or YAML) documents.

class curategpt.wrappers.general.json_wrapper.JSONWrapper(source_locator=None, local_store=None, extractor=None, format=None, path_expression=None)

Bases: BaseWrapper

A wrapper over a json (or yaml) document.

Uses json path expressions

This is a static wrapper: it cannot be searched

format: str = None
name: ClassVar[str] = 'json'
objects(collection=None, object_ids=None, **kwargs)

Return all objects in the view.

Parameters:
  • collection (Optional[str])

  • object_ids (Optional[Iterable[str]]) – Optional list of IDs to fetch

  • kwargs

Return type:

Iterator[Dict]

Returns:

path_expression: str = None
wrap_object(obj)

Convert an object from the source representation to the store representation.

Parameters:

obj (Dict)

Return type:

Iterator[Dict]

Returns:

curategpt.wrappers.general.linkml_schema_wrapper module

Wrapper for LinkML Schema documents.

class curategpt.wrappers.general.linkml_schema_wrapper.LinkMLSchemarapper(source_locator=None, local_store=None, extractor=None)

Bases: BaseWrapper

A wrapper over linkml schema documents.

Each object is a schema element (class, slot, type, enum)

from_schemaview(sv)
Return type:

Iterator[Dict]

name: ClassVar[str] = 'linkml_schema'
objects(collection=None, object_ids=None, **kwargs)

Return all objects in the view.

Parameters:
  • collection (Optional[str])

  • object_ids (Optional[Iterable[str]]) – Optional list of IDs to fetch

  • kwargs

Return type:

Iterator[Dict]

Returns:

Module contents