tooluniverse.openfda_adv_tool 模块

class tooluniverse.openfda_adv_tool.FDADrugAdverseEventTool[源代码]

基类:BaseTool

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

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

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

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

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

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

备注

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

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

validate_enum_arguments(arguments)[源代码]

验证基于枚举的参数是否符合允许的值

_post_process(response, reaction_filter=None)[源代码]
_map_value(param_name, value)[源代码]
class tooluniverse.openfda_adv_tool.FDACountAdditiveReactionsTool[源代码]

基类:FDADrugAdverseEventTool

利用 openFDA API 在一次请求中统计多种药物的不良反应事件数。

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

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

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

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

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

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

备注

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

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

class tooluniverse.openfda_adv_tool.FDADrugAdverseEventDetailTool[源代码]

基类:BaseTool

Tool for retrieving detailed adverse event reports from FAERS. Uses limit/skip parameters instead of count aggregation.

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

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

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

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

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

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

备注

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

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

validate_enum_arguments(arguments)[源代码]

验证基于枚举的参数是否符合允许的值

_extract_essential_fields(report)[源代码]

Extract only essential fields from a FAERS report. Removes verbose metadata like openfda to keep output concise. Can be customized via tool_config[‘fields’][‘essential_fields’].

_extract_custom_fields(report, field_config)[源代码]

Extract fields based on custom configuration. field_config can be a list of field paths or a dict with inclusion rules.

_get_nested_value(obj, path)[源代码]

Get value from nested dict using dot notation path

_set_nested_value(obj, path, value)[源代码]

Set value in nested dict using dot notation path

_map_value(param_name, value)[源代码]
class tooluniverse.openfda_adv_tool.FDADrugInteractionDetailTool[源代码]

基类:BaseTool

Tool for retrieving detailed adverse event reports involving multiple drugs (drug interactions). Uses limit/skip parameters instead of count aggregation.

__init__(tool_config, endpoint_url='https://api.fda.gov/drug/event.json', api_key=None)[源代码]
run(arguments)[源代码]

执行该工具。

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

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

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

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

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

备注

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

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

validate_enum_arguments(arguments)[源代码]

验证基于枚举的参数是否符合允许的值

_extract_essential_fields(report)[源代码]

Extract only essential fields from a FAERS report. Removes verbose metadata like openfda to keep output concise. Can be customized via tool_config[‘fields’][‘essential_fields’].

_extract_custom_fields(report, field_config)[源代码]

Extract fields based on custom configuration. field_config can be a list of field paths or a dict with inclusion rules.

_get_nested_value(obj, path)[源代码]

Get value from nested dict using dot notation path

_set_nested_value(obj, path, value)[源代码]

Set value in nested dict using dot notation path

_map_value(param_name, value)[源代码]