Browse Source

v0.7
修改判断是否存在的逻辑

罗俊辉 11 months ago
parent
commit
d9b462abf2
1 changed files with 17 additions and 0 deletions
  1. 17 0
      test/dev.py

+ 17 - 0
test/dev.py

@@ -0,0 +1,17 @@
+import json
+
+from tavily import TavilyClient
+
+
+def tavily_ai(prompt):
+    tavily = TavilyClient(api_key="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")
+    # For advanced search:
+    response = tavily.search(
+        query="{}, 通过这个标题生成一遍文章".format(prompt),
+        search_depth="advanced",
+        include_images=True,
+        include_answer=True,
+        include_raw_content=True
+
+    )
+    return response