Skip to content

Commit 7820e37

Browse files
committed
Move tool call exmaple file and add link to README
1 parent 31614cd commit 7820e37

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ are listed in [the last section of this file](#customize).
7878
- [Message history with Neo4j](./customize/llms/llm_with_neo4j_message_history.py)
7979
- [System Instruction](./customize/llms/llm_with_system_instructions.py)
8080

81+
- [Tool Calling with OpenAI](./customize/llms/openai_tool_calls.py)
82+
8183

8284
### Prompts
8385

examples/tool_calls/openai_tool_calls.py renamed to examples/customize/llms/openai_tool_calls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from neo4j_graphrag.llm.types import ToolCallResponse
2020
from neo4j_graphrag.tool import Tool, ObjectParameter, StringParameter, IntegerParameter
2121

22-
# Load environment variables from .env file
22+
# Load environment variables from .env file (OPENAI_API_KEY required for this example)
2323
load_dotenv()
2424

2525

@@ -52,13 +52,13 @@ def process_tool_calls(response: ToolCallResponse) -> Dict[str, Any]:
5252

5353
print(f"\nNumber of tool calls: {len(response.tool_calls)}")
5454
print(f"Additional content: {response.content or 'None'}")
55-
55+
5656
results = []
5757
for i, tool_call in enumerate(response.tool_calls):
58-
print(f"\nTool call #{i+1}: {tool_call.name}")
58+
print(f"\nTool call #{i + 1}: {tool_call.name}")
5959
print(f"Arguments: {tool_call.arguments}")
6060
results.append(tool_call.arguments)
61-
61+
6262
# For backward compatibility, return the first tool call's arguments
6363
return results[0] if results else {}
6464

0 commit comments

Comments
 (0)