curategpt.app package

Submodules

curategpt.app.app module

Streamlit app for CurateGPT.

curategpt.app.app.ask_chatbot(query, expand=False)
Return type:

ChatResponse

curategpt.app.app.filtered_collection_names()
Return type:

List[str]

curategpt.app.app.get_chat_agent()
Return type:

Union[ChatAgent, BaseWrapper]

curategpt.app.app.html_table(rows)
Return type:

str

curategpt.app.cart module

class curategpt.app.cart.Cart(**data)

Bases: BaseModel

A cart is a list of items that can be added to or removed from

add(item)
items: List[CartItem]
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]] = {'items': FieldInfo(annotation=List[curategpt.app.cart.CartItem], required=False, default=[])}

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.

remove(item)
property size
class curategpt.app.cart.CartItem(**data)

Bases: BaseModel

A cart item is a single item in a cart

metadata: Optional[Dict]
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]] = {'metadata': FieldInfo(annotation=Union[Dict, NoneType], required=False, default=None), 'object': FieldInfo(annotation=Union[Dict, BaseModel], required=True), 'object_type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'source': FieldInfo(annotation=Union[str, NoneType], 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.

object: Union[Dict, BaseModel]
object_type: Optional[str]
source: Optional[str]

curategpt.app.components module

class curategpt.app.components.DimensionalityReductionOptions(value)

Bases: str, Enum

An enumeration.

PCA = 'PCA'
TSNE = 't-SNE'
UMAP = 'UMAP'
curategpt.app.components.limit_slider_component(name='Max examples', tooltip='\nExamples that are similar to your query are picked from the selected\nknowledge base, and used as context to guide the LLM.\nIf you pick too many examples, it may go beyond the limits of the context window\nfor the model you selected.\n')
curategpt.app.components.vectors_to_fig(labels, vectors, method=None)

curategpt.app.helper module

Utilities for streamlit app.

curategpt.app.helper.get_applicable_examples(collection, mode, relax=True)

Get applicable examples for a given collection and mode.

Parameters:
  • collection (Optional[str])

  • mode (str)

Return type:

List[Dict]

Returns:

curategpt.app.helper.get_case_collection()

curategpt.app.state module

class curategpt.app.state.ApplicationState(page=None, db=<factory>, extractor=<factory>, cart=<factory>, page_states=<factory>)

Bases: object

cart: Cart
db: DBAdapter
extractor: Extractor
get_page_state(page_name)
Return type:

PageState

page: Optional[str] = None
page_states: Dict[str, PageState]
class curategpt.app.state.PageState(predicted_object=None, chat_response=None, results=None, selected=None)

Bases: object

chat_response: ChatResponse = None
predicted_object: AnnotatedObject = None
results: List = None
selected: Any = None
curategpt.app.state.get_state(st)

Gets the application state from the streamlit session state

Parameters:

st

Return type:

ApplicationState

Returns:

Module contents