langchain_community.document_loaders.github.GitHubIssuesLoader

class langchain_community.document_loaders.github.GitHubIssuesLoader[source]

Bases: BaseGitHubLoader

加载GitHub存储库的问题。

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param access_token: str [Required]

个人访问令牌 - 请参阅https://github.com/settings/tokens?type=beta

param assignee: Optional[str] = None

过滤已分配的用户。传递’none’表示没有用户,传递’*’表示任何用户。

param creator: Optional[str] = None

过滤创建了问题的用户。

param direction: Optional[Literal['asc', 'desc']] = None

结果 按照结果排序的方向。可以是:’asc’(升序)、’desc’(降序)。

param github_api_url: str = 'https://api.github.com'

GitHub API的URL

param include_prs: bool = True

如果为True,则包括拉取请求在结果中,否则忽略它们。

param labels: Optional[List[str]] = None

过滤标签名称。例如:bug,ui,@high。

param mentioned: Optional[str] = None

过滤在问题中提到的用户。

param milestone: Optional[Union[int, Literal['*', 'none']]] = None

如果传递整数,则应该是里程碑的数字字段。 如果传递字符串’*’,则接受具有任何里程碑的问题。 如果传递字符串’none’,则返回没有里程碑的问题。

param page: Optional[int] = None

分页结果的页码。 在GitHub API中默认为1。

param per_page: Optional[int] = None

每页的项目数量。默认为GitHub API中的30。

param repo: str [Required]

存储库的名称

param since: Optional[str] = None

仅显示在给定时间之后更新的通知。 这是一个ISO 8601格式的时间戳:YYYY-MM-DDTHH:MM:SSZ。

param sort: Optional[Literal['created', 'updated', 'comments']] = None

按什么排序结果。可以是以下之一:’created’,’updated’,’comments’。 默认为’created’。

param state: Optional[Literal['open', 'closed', 'all']] = None

过滤问题状态。可以是以下之一:’open’(打开),’closed’(关闭),’all’(全部)。

async alazy_load() AsyncIterator[Document]

一个用于文档的惰性加载器。

Return type

AsyncIterator[Document]

async aload() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

Parameters
  • _fields_set (Optional[SetStr]) –

  • values (Any) –

Return type

Model

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to include in new model

  • exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) – fields to exclude from new model, as with values this takes precedence over include

  • update (Optional[DictStrAny]) – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep (bool) – set to True to make a deep copy of the model

  • self (Model) –

Returns

new model instance

Return type

Model

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

Parameters
  • include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) –

  • exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) –

  • by_alias (bool) –

  • skip_defaults (Optional[bool]) –

  • exclude_unset (bool) –

  • exclude_defaults (bool) –

  • exclude_none (bool) –

Return type

DictStrAny

classmethod from_orm(obj: Any) Model
Parameters

obj (Any) –

Return type

Model

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

Parameters
  • include (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) –

  • exclude (Optional[Union[AbstractSetIntStr, MappingIntStrAny]]) –

  • by_alias (bool) –

  • skip_defaults (Optional[bool]) –

  • exclude_unset (bool) –

  • exclude_defaults (bool) –

  • exclude_none (bool) –

  • encoder (Optional[Callable[[Any], Any]]) –

  • models_as_dict (bool) –

  • dumps_kwargs (Any) –

Return type

unicode

lazy_load() Iterator[Document][source]

获取GitHub存储库的问题。

返回:
一个具有以下属性的文档列表:
  • 页面内容

  • 元数据
    • 网址

    • 标题

    • 创建者

    • 创建时间

    • 最后更新时间

    • 关闭时间

    • 评论数量

    • 状态

    • 标签

    • 被指派者

    • 多个被指派者

    • 里程碑

    • 已锁定

    • 编号

    • 是否为拉取请求

Return type

Iterator[Document]

load() List[Document]

将数据加载到文档对象中。

Return type

List[Document]

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]

加载文档并分割成块。块作为文档返回。

不要覆盖此方法。应该被视为已弃用!

参数:
text_splitter: 用于分割文档的TextSplitter实例。

默认为RecursiveCharacterTextSplitter。

返回:

文档列表。

Parameters

text_splitter (Optional[TextSplitter]) –

Return type

List[Document]

classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) Model
Parameters
  • path (Union[str, Path]) –

  • content_type (unicode) –

  • encoding (unicode) –

  • proto (Protocol) –

  • allow_pickle (bool) –

Return type

Model

parse_issue(issue: dict) Document[source]

从GitHub问题列表创建文档对象。

Parameters

issue (dict) –

Return type

Document

classmethod parse_obj(obj: Any) Model
Parameters

obj (Any) –

Return type

Model

classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) Model
Parameters
  • b (Union[str, bytes]) –

  • content_type (unicode) –

  • encoding (unicode) –

  • proto (Protocol) –

  • allow_pickle (bool) –

Return type

Model

classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
Parameters
  • by_alias (bool) –

  • ref_template (unicode) –

Return type

DictStrAny

classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
Parameters
  • by_alias (bool) –

  • ref_template (unicode) –

  • dumps_kwargs (Any) –

Return type

unicode

classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

Parameters

localns (Any) –

Return type

None

classmethod validate(value: Any) Model
Parameters

value (Any) –

Return type

Model

property headers: Dict[str, str]
property query_params: str

为GitHub API创建查询参数。

property url: str

创建用于GitHub API的URL。

Examples using GitHubIssuesLoader