From 007c2ef34de3dae600525a5e069bc648af42b8a3 Mon Sep 17 00:00:00 2001 From: Hamada Salhab Date: Tue, 8 Oct 2024 19:47:13 +0300 Subject: [PATCH] Docs(README): Fix mistakes in README (#613) > [!IMPORTANT] > Fixes mistakes in README files by updating provider names, session chat structures, and document handling functions. > > - **Provider and API Key Updates**: > - Change `provider` from `google` to `brave` and update `api_key` references in `README.md`, `README-CN.md`, and `README-JP.md`. > - **Session Chat Structure**: > - Update `client.sessions.chat` to use `messages` array instead of `message` string in `README.md`, `README-CN.md`, and `README-JP.md`. > - **Document Handling**: > - Change `client.documents.create` to `client.agents.docs.create` and `client.documents.search` to `client.agents.docs.search` in `README.md`, `README-CN.md`, and `README-JP.md`. > > This description was created by [Ellipsis](https://www.ellipsis.dev?ref=julep-ai%2Fjulep&utm_source=github&utm_medium=referral) for 867ad7539fa922a1c98b575537666a107d7465c8. It will automatically update as commits are pushed. --- README-CN.md | 22 ++++++++++++++-------- README-JP.md | 24 +++++++++++++++--------- README.md | 19 ++++++++++++------- 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/README-CN.md b/README-CN.md index d5cb2c2de..b8f19f31a 100644 --- a/README-CN.md +++ b/README-CN.md @@ -596,9 +596,9 @@ client.agents.tools.create( name="web_search", description="搜索网络以获取信息。", integration={ - "provider": "google", + "provider": "brave", "method": "search", - "setup": {"api_key": "your_google_api_key"}, + "setup": {"api_key": "your_brave_api_key"}, }, ) ``` @@ -617,7 +617,12 @@ session = client.sessions.create( # 在同一会话中继续对话 response = client.sessions.chat( session_id=session.id, - message="继续我们之前的对话。" + messages=[ + { + "role": "user", + "content": "继续我们之前的对话。" + } + ] ) ``` @@ -627,15 +632,16 @@ response = client.sessions.chat( ```python # 上传文档 -document = client.documents.create( - file="path/to/document.pdf", +document = client.agents.docs.create( + title="AI advancements", + content="AI is changing the world...", metadata={"category": "research_paper"} ) # 搜索文档 -results = client.documents.search( - query="AI 进展", - filter={"category": "research_paper"} +results = client.agents.docs.search( + text="AI advancements", + metadata_filter={"category": "research_paper"} ) ``` diff --git a/README-JP.md b/README-JP.md index 8cd716ade..fb3c1dd97 100644 --- a/README-JP.md +++ b/README-JP.md @@ -600,9 +600,9 @@ client.agents.tools.create( name="web_search", description="Search the web for information.", integration={ - "provider": "google", + "provider": "brave", "method": "search", - "setup": {"api_key": "your_google_api_key"}, + "setup": {"api_key": "your_brave_api_key"}, }, ) ``` @@ -614,14 +614,19 @@ Julepは、持続的なインタラクションのための強力なセッショ ```python session = client.sessions.create( agent_id=agent.id, - user_id="user123", + user_id=user.id, context_overflow="adaptive" ) # 同じセッションで会話を続ける response = client.sessions.chat( session_id=session.id, - message="Follow up on our previous conversation." + messages=[ + { + "role": "user", + "content": "Follow up on our previous conversation." + } + ] ) ``` @@ -631,15 +636,16 @@ response = client.sessions.chat( ```python # ドキュメントをアップロードする -document = client.documents.create( - file="path/to/document.pdf", +document = client.agents.docs.create( + title="AI advancements", + content="AI is changing the world...", metadata={"category": "research_paper"} ) # ドキュメントを検索する -results = client.documents.search( - query="AI advancements", - filter={"category": "research_paper"} +results = client.agents.docs.search( + text="AI advancements", + metadata_filter={"category": "research_paper"} ) ``` diff --git a/README.md b/README.md index 9c44f7f6d..b636f4718 100644 --- a/README.md +++ b/README.md @@ -791,9 +791,9 @@ client.agents.tools.create( name="web_search", description="Search the web for information.", integration={ - "provider": "google", + "provider": "brave", "method": "search", - "setup": {"api_key": "your_google_api_key"}, + "setup": {"api_key": "your_brave_api_key"}, }, ) ``` @@ -805,14 +805,19 @@ Julep provides robust session management for persistent interactions: ```python session = client.sessions.create( agent_id=agent.id, - user_id="user123", + user_id=user.id, context_overflow="adaptive" ) # Continue conversation in the same session response = client.sessions.chat( session_id=session.id, - message="Follow up on our previous conversation." + messages=[ + { + "role": "user", + "content": "Follow up on the previous conversation." + } + ] ) ``` @@ -822,15 +827,15 @@ Easily manage and search through documents for your agents: ```python # Upload a document -document = client.documents.create( +document = client.agents.docs.create( title="AI advancements", content="AI is changing the world...", metadata={"category": "research_paper"} ) # Search documents -results = client.documents.search( - query="AI advancements", +results = client.agents.docs.search( + text="AI advancements", metadata_filter={"category": "research_paper"} ) ```