Skip to content

Make com

MakeWrapper #

Bases: BaseReader

创建读取器。

Source code in llama_index/readers/make_com/base.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class MakeWrapper(BaseReader):
    """创建读取器。"""

    def load_data(self, *args: Any, **load_kwargs: Any) -> List[Document]:
        """从输入目录加载数据。

注意:这部分尚未实现。
"""
        raise NotImplementedError("Cannot load documents from Make.com API.")

    def pass_response_to_webhook(
        self, webhook_url: str, response: Response, query: Optional[str] = None
    ) -> None:
        """将响应对象传递给webhook。

Args:
    webhook_url (str): Webhook URL。
    response (Response): 响应对象。
    query (Optional[str]): 查询。默认为None。
"""
        response_text = response.response
        source_nodes = [n.dict() for n in response.source_nodes]
        json_dict = {
            "response": response_text,
            "source_nodes": source_nodes,
            "query": query,
        }
        r = requests.post(webhook_url, json=json_dict)
        r.raise_for_status()

load_data #

load_data(*args: Any, **load_kwargs: Any) -> List[Document]

从输入目录加载数据。

注意:这部分尚未实现。

Source code in llama_index/readers/make_com/base.py
18
19
20
21
22
23
    def load_data(self, *args: Any, **load_kwargs: Any) -> List[Document]:
        """从输入目录加载数据。

注意:这部分尚未实现。
"""
        raise NotImplementedError("Cannot load documents from Make.com API.")

pass_response_to_webhook #

pass_response_to_webhook(
    webhook_url: str,
    response: Response,
    query: Optional[str] = None,
) -> None

将响应对象传递给webhook。

Parameters:

Name Type Description Default
webhook_url str

Webhook URL。

required
response Response

响应对象。

required
query Optional[str]

查询。默认为None。

None
Source code in llama_index/readers/make_com/base.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
    def pass_response_to_webhook(
        self, webhook_url: str, response: Response, query: Optional[str] = None
    ) -> None:
        """将响应对象传递给webhook。

Args:
    webhook_url (str): Webhook URL。
    response (Response): 响应对象。
    query (Optional[str]): 查询。默认为None。
"""
        response_text = response.response
        source_nodes = [n.dict() for n in response.source_nodes]
        json_dict = {
            "response": response_text,
            "source_nodes": source_nodes,
            "query": query,
        }
        r = requests.post(webhook_url, json=json_dict)
        r.raise_for_status()