这是indexloc提供的服务,不要输入任何密码
Skip to content

add support for Grok live search #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 22, 2025
Merged

add support for Grok live search #20

merged 1 commit into from
Jul 22, 2025

Conversation

homanp
Copy link
Contributor

@homanp homanp commented Jul 22, 2025

What does this PR do?

This pull request introduces several updates to enhance the functionality of the Grok CLI, including support for real-time search capabilities, improved tool handling, and code quality improvements. The key changes are grouped below:

New Features and Enhancements:

  • Added support for real-time web search and social media data by introducing SearchParameters and SearchOptions interfaces, and updating the GrokClient to handle search parameters in chat, chatStream, and a new search method. (src/grok/client.ts: [1] [2] F88e776dL83R132, [3]
  • Updated the ChatEntry interface to include a new tool_call type, allowing for better tracking of tool usage during interactions. (src/agent/grok-agent.ts: src/agent/grok-agent.tsL10-R10)
  • Enhanced the agent's tool usage by introducing real-time information tools and updating tool call handling in the agent loop and streaming responses. (src/agent/grok-agent.ts: [1] [2] [3] [4]

Tool Updates:

  • Refactored the GROK_TOOLS definitions to use consistent formatting and added required fields for tool parameters. (src/grok/tools.ts: src/grok/tools.tsL1-R174)

UI and Interaction Improvements:

  • Updated the ChatHistory component to handle tool_call entries, displaying them appropriately in the chat interface. (src/ui/components/chat-history.tsx: [1] [2]
  • Enhanced input handling by displaying individual tool call entries in the chat history when tools are executed. (src/hooks/use-input-handler.ts: src/hooks/use-input-handler.tsL252-R286)

Code Quality and Consistency:

  • Replaced single quotes with double quotes across multiple files for consistent string formatting. (src/grok/client.ts: [1] src/grok/tools.ts: [2] src/tools/index.ts: [3]
  • Improved readability of array and object formatting in use-input-handler.ts and other files. (src/hooks/use-input-handler.ts: [1] [2] [3]

Version Update:

  • Incremented the package version from 0.0.2 to 0.0.3 in package.json. (package.json: package.jsonL3-R3)

Fixes #3

Checklist

  • I tested my changes
  • I reviewed my own code

@homanp homanp self-assigned this Jul 22, 2025
@homanp homanp merged commit 1d45dd3 into main Jul 22, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add native Grok search tool
1 participant