curategpt.wrappers package
Subpackages
- curategpt.wrappers.bio package
- Submodules
- curategpt.wrappers.bio.alliance_gene_wrapper module
- curategpt.wrappers.bio.bacdive_wrapper module
- curategpt.wrappers.bio.gocam_wrapper module
- curategpt.wrappers.bio.mediadive_wrapper module
- curategpt.wrappers.bio.omicsdi_wrapper module
- curategpt.wrappers.bio.reactome_wrapper module
- curategpt.wrappers.bio.uniprot_wrapper module
- Module contents
- curategpt.wrappers.clinical package
- Submodules
- curategpt.wrappers.clinical.clinvar_wrapper module
- curategpt.wrappers.clinical.ctgov_wrapper module
- curategpt.wrappers.clinical.hpoa_by_pub_wrapper module
- curategpt.wrappers.clinical.hpoa_wrapper module
- curategpt.wrappers.clinical.maxoa_wrapper module
- Module contents
- curategpt.wrappers.general package
- Submodules
- curategpt.wrappers.general.filesystem_wrapper module
- curategpt.wrappers.general.github_wrapper module
Comment
GitHubWrapper
GitHubWrapper.cache_name
GitHubWrapper.default_object_type
GitHubWrapper.external_search()
GitHubWrapper.headers
GitHubWrapper.issue_comments()
GitHubWrapper.name
GitHubWrapper.objects()
GitHubWrapper.owner
GitHubWrapper.pr_comments()
GitHubWrapper.repo
GitHubWrapper.repo_description
GitHubWrapper.session
GitHubWrapper.transform_issue()
Issue
PullRequest
get_token()
pr_comments()
- curategpt.wrappers.general.google_drive_wrapper module
GoogleDriveWrapper
GoogleDriveWrapper.default_doc_types
GoogleDriveWrapper.external_search()
GoogleDriveWrapper.google_drive_id
GoogleDriveWrapper.google_folder_id
GoogleDriveWrapper.name
GoogleDriveWrapper.objects_by_ids()
GoogleDriveWrapper.objects_from_files()
GoogleDriveWrapper.search_limit_multiplier
GoogleDriveWrapper.service
- curategpt.wrappers.general.gspread_wrapper module
- curategpt.wrappers.general.json_wrapper module
- curategpt.wrappers.general.linkml_schema_wrapper module
- Module contents
- curategpt.wrappers.investigation package
- Submodules
- curategpt.wrappers.investigation.ess_deepdive_wrapper module
- curategpt.wrappers.investigation.fairsharing_wrapper module
- curategpt.wrappers.investigation.jgi_wrapper module
- curategpt.wrappers.investigation.ncbi_bioproject_wrapper module
- curategpt.wrappers.investigation.ncbi_biosample_wrapper module
- curategpt.wrappers.investigation.nmdc_wrapper module
- Module contents
- curategpt.wrappers.legal package
- curategpt.wrappers.literature package
- Submodules
- curategpt.wrappers.literature.bioc_wrapper module
- curategpt.wrappers.literature.eutils_wrapper module
- curategpt.wrappers.literature.pmc_wrapper module
- curategpt.wrappers.literature.pubmed_wrapper module
PubmedWrapper
PubmedWrapper.email
PubmedWrapper.eutils_client
PubmedWrapper.external_search()
PubmedWrapper.fetch_full_text()
PubmedWrapper.fetch_pmcid()
PubmedWrapper.is_fetch_full_text
PubmedWrapper.name
PubmedWrapper.ncbi_key
PubmedWrapper.objects_by_ids()
PubmedWrapper.pmc_full_text()
PubmedWrapper.pmc_xml()
PubmedWrapper.session
PubmedWrapper.set_cache()
PubmedWrapper.where
extract_all_text()
extract_text_from_xml()
- curategpt.wrappers.literature.wikipedia_wrapper module
- Module contents
BiocWrapper
PubmedWrapper
PubmedWrapper.email
PubmedWrapper.eutils_client
PubmedWrapper.external_search()
PubmedWrapper.fetch_full_text()
PubmedWrapper.fetch_pmcid()
PubmedWrapper.is_fetch_full_text
PubmedWrapper.name
PubmedWrapper.ncbi_key
PubmedWrapper.objects_by_ids()
PubmedWrapper.pmc_full_text()
PubmedWrapper.pmc_xml()
PubmedWrapper.session
PubmedWrapper.set_cache()
PubmedWrapper.where
WikipediaWrapper
- curategpt.wrappers.ontology package
- Submodules
- curategpt.wrappers.ontology.bioportal_wrapper module
- curategpt.wrappers.ontology.oboformat_wrapper module
- curategpt.wrappers.ontology.ontology module
- curategpt.wrappers.ontology.ontology_wrapper module
OntologyWrapper
OntologyWrapper.as_object()
OntologyWrapper.branches
OntologyWrapper.default_max_search_results
OntologyWrapper.external_search()
OntologyWrapper.fetch_definitions
OntologyWrapper.fetch_relationships
OntologyWrapper.id_to_shorthand
OntologyWrapper.name
OntologyWrapper.oak_adapter
OntologyWrapper.objects()
OntologyWrapper.relationships_as_fields
OntologyWrapper.retrieve_shorthand_to_id_from_store()
OntologyWrapper.shorthand_to_id
OntologyWrapper.text_field
OntologyWrapper.unwrap_object()
OntologyWrapper.unwrap_objects()
- Module contents
OntologyWrapper
OntologyWrapper.as_object()
OntologyWrapper.branches
OntologyWrapper.default_max_search_results
OntologyWrapper.external_search()
OntologyWrapper.fetch_definitions
OntologyWrapper.fetch_relationships
OntologyWrapper.id_to_shorthand
OntologyWrapper.name
OntologyWrapper.oak_adapter
OntologyWrapper.objects()
OntologyWrapper.relationships_as_fields
OntologyWrapper.retrieve_shorthand_to_id_from_store()
OntologyWrapper.shorthand_to_id
OntologyWrapper.text_field
OntologyWrapper.unwrap_object()
OntologyWrapper.unwrap_objects()
Submodules
curategpt.wrappers.base_wrapper module
Chat with a KB.
- class curategpt.wrappers.base_wrapper.BaseWrapper(source_locator=None, local_store=None, extractor=None)
Bases:
ABC
A virtual store that implements a view over some remote or external source.
- chat(query, collection=None, **kwargs)
Chat with a wrapper view (e.g pubmed).
- Parameters:
query (
str
)collection (
Optional
[str
])kwargs
- Return type:
Any
- Returns:
Deprecated since version Use: a chat agent with a wrapper as source instead
- create_curie(local_id)
Create a CURIE for the given local ID.
- Parameters:
local_id (
str
)- Return type:
str
- Returns:
- default_embedding_model = 'openai:'
- default_object_type = 'Publication'
- external_search(text, expand=True, **kwargs)
Search an external source and return the results.
- Parameters:
text (
str
)kwargs
- Return type:
List
[Dict
]- Returns:
- extract_concepts_from_text(text, **kwargs)
- max_text_length = 3000
-
name:
ClassVar
[str
] = '__dbview__'
- 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 fetchkwargs
- Return type:
Iterator
[Dict
]- Returns:
- objects_by_ids(object_ids)
Return objects by their IDs.
- Parameters:
object_ids (
List
[str
])- Return type:
List
[Dict
]- Returns:
-
prefix:
ClassVar
[str
] = None
- search(text, collection=None, cache=True, expand=True, limit=None, external_search_limit=None, **kwargs)
Search an external source and cache the results in the local store.
- Parameters:
text (
str
)collection (
Optional
[str
]) – used for cachingkwargs
- Return type:
Iterator
[Tuple
[DuckDBSearchResult
,Dict
,float
,Optional
[Dict
]]]- Returns:
-
search_limit_multiplier:
ClassVar
[int
] = 3
-
source_locator:
Union
[str
,Path
,None
] = None
- split_objects(objects, text_field='text', id_field='id')
Split objects with text above a certain length into multiple objects.
- Parameters:
objects (
List
[Dict
])- Return type:
List
[Dict
]- Returns:
- text_overlap = 200
- unwrap_object(obj, store, **kwargs)
Convert an object from the store to the source representation.
reverse transform of as_object
- Parameters:
obj (
Dict
[str
,Any
])store (
DBAdapter
)kwargs
- Return type:
Any
- Returns:
- wrap_object(obj)
Convert an object from the source representation to the store representation.
- Parameters:
obj (
Dict
)- Return type:
Iterator
[Dict
]- Returns:
Module contents
Wrappers on top of external data sources.
Wrappers allow for dynamic or static loading of an external data source into a store.
- class curategpt.wrappers.BaseWrapper(source_locator=None, local_store=None, extractor=None)
Bases:
ABC
A virtual store that implements a view over some remote or external source.
- chat(query, collection=None, **kwargs)
Chat with a wrapper view (e.g pubmed).
- Parameters:
query (
str
)collection (
Optional
[str
])kwargs
- Return type:
Any
- Returns:
Deprecated since version Use: a chat agent with a wrapper as source instead
- create_curie(local_id)
Create a CURIE for the given local ID.
- Parameters:
local_id (
str
)- Return type:
str
- Returns:
- default_embedding_model = 'openai:'
- default_object_type = 'Publication'
- external_search(text, expand=True, **kwargs)
Search an external source and return the results.
- Parameters:
text (
str
)kwargs
- Return type:
List
[Dict
]- Returns:
- extract_concepts_from_text(text, **kwargs)
- max_text_length = 3000
-
name:
ClassVar
[str
] = '__dbview__'
- 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 fetchkwargs
- Return type:
Iterator
[Dict
]- Returns:
- objects_by_ids(object_ids)
Return objects by their IDs.
- Parameters:
object_ids (
List
[str
])- Return type:
List
[Dict
]- Returns:
-
prefix:
ClassVar
[str
] = None
- search(text, collection=None, cache=True, expand=True, limit=None, external_search_limit=None, **kwargs)
Search an external source and cache the results in the local store.
- Parameters:
text (
str
)collection (
Optional
[str
]) – used for cachingkwargs
- Return type:
Iterator
[Tuple
[DuckDBSearchResult
,Dict
,float
,Optional
[Dict
]]]- Returns:
-
search_limit_multiplier:
ClassVar
[int
] = 3
-
source_locator:
Union
[str
,Path
,None
] = None
- split_objects(objects, text_field='text', id_field='id')
Split objects with text above a certain length into multiple objects.
- Parameters:
objects (
List
[Dict
])- Return type:
List
[Dict
]- Returns:
- text_overlap = 200
- unwrap_object(obj, store, **kwargs)
Convert an object from the store to the source representation.
reverse transform of as_object
- Parameters:
obj (
Dict
[str
,Any
])store (
DBAdapter
)kwargs
- Return type:
Any
- Returns:
- wrap_object(obj)
Convert an object from the source representation to the store representation.
- Parameters:
obj (
Dict
)- Return type:
Iterator
[Dict
]- Returns:
- curategpt.wrappers.get_wrapper(name, **kwargs)
- Return type: