tooluniverse.fatcat_tool 模块

class tooluniverse.fatcat_tool.FatcatResultParser[源代码]

基类:HTMLParser

Parse Fatcat search results from HTML.

__init__()[源代码]

Initialize and reset this instance.

If convert_charrefs is true (the default), all character references are automatically converted to the corresponding Unicode characters.

If scripting is false (the default), the content of the noscript element is parsed normally; if it’s true, it’s returned as is without being parsed.

handle_starttag(tag, attrs)[源代码]
handle_data(data)[源代码]
handle_endtag(tag)[源代码]
class tooluniverse.fatcat_tool.FatcatMetadataParser[源代码]

基类:HTMLParser

Extract metadata from Fatcat release page meta tags.

__init__()[源代码]

Initialize and reset this instance.

If convert_charrefs is true (the default), all character references are automatically converted to the corresponding Unicode characters.

If scripting is false (the default), the content of the noscript element is parsed normally; if it’s true, it’s returned as is without being parsed.

handle_starttag(tag, attrs)[源代码]
class tooluniverse.fatcat_tool.FatcatScholarTool[源代码]

基类:BaseTool

通过 Fatcat 发布搜索功能检索 Internet Archive Scholar。

Uses web scraping of the scholar.archive.org interface to retrieve bibliographic information about research papers and publications.

参数(参数列表):

query (str):查询字符串 max_results (int):最大结果数(默认值 10,最大值 100)

__init__(tool_config)[源代码]
run(arguments=None)[源代码]

执行该工具。

默认的 BaseTool 实现接受一个可选的参数映射,以符合大多数具体工具实现所期望的输入字典。

参数:
  • arguments (dict, optional) – 工具专用参数

  • stream_callback (callable, optional) – 用于流式响应的回调

  • use_cache (bool, optional) – 是否启用了结果缓存

  • validate (bool, optional) – 是否已执行参数验证

备注

这些附加参数(stream_callback、use_cache、validate)由 run_one_function() 传递,用于提供有关执行的上下文信息。工具可以利用这些参数进行优化或特殊处理。

为了向后兼容,不接受这些参数的工具仍然可以正常工作——它们只会接收到 arguments 参数。