Skip to content

Added new model options for pplx sonar model #201

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vivek-athina
Copy link
Collaborator

@vivek-athina vivek-athina commented Jun 6, 2025

Summary by CodeRabbit

  • New Features

    • Added support for specifying search mode and search context size when executing prompts, allowing for enhanced search customization in prompt executions.
  • Chores

    • Updated package version to 1.7.40.

Copy link
Contributor

coderabbitai bot commented Jun 6, 2025

Walkthrough

The PromptExecution class in athina/steps/llm.py was updated to include two new optional string attributes, search_mode and search_context_size. These attributes are now incorporated into the payload for all prompt execution methods. Additionally, the package version in pyproject.toml was incremented.

Changes

File(s) Change Summary
athina/steps/llm.py Added search_mode and search_context_size as optional attributes to PromptExecution. Updated all execution methods to include these in the LLM service payload.
pyproject.toml Bumped version from 1.7.39 to 1.7.40.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PromptExecution
    participant LLMService

    User->>PromptExecution: initiate prompt execution (with optional search_mode, search_context_size)
    PromptExecution->>LLMService: send payload (includes search_mode, web_search_options.search_context_size if set)
    LLMService-->>PromptExecution: return results
    PromptExecution-->>User: deliver results
Loading

Possibly related PRs

  • [ATH-3789] support thinking for claude #194: Both PRs extend the PromptExecution class in athina/steps/llm.py by adding new optional attributes that are incorporated into the parameters passed to LLM service calls, indicating a related enhancement pattern to prompt execution capabilities.

Suggested reviewers

  • Akhilathina

Poem

In fields of code where prompts reside,
New options now can hop inside—
Search mode and context, neat and bright,
Help LLMs to get it right.
With version bumped, the bunnies cheer,
For clever queries now appear!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
athina/steps/llm.py (1)

475-484: Same code duplication issue as in execute_async method.

This is the third instance of identical search parameter logic. The refactoring suggestion from the execute_async method applies here as well.

🧹 Nitpick comments (1)
athina/steps/llm.py (1)

380-389: Code duplication detected - consider refactoring.

This logic is identical to the implementation in the execute method. Consider extracting this into a helper method to eliminate duplication.

def _build_search_params(self):
    """Build search-related parameters for LLM service calls."""
    params = {}
    if self.search_mode:
        params["search_mode"] = self.search_mode
    
    web_search_options = {}
    if self.search_context_size:
        web_search_options["search_context_size"] = self.search_context_size
    if web_search_options:
        params["web_search_options"] = web_search_options
    
    return params

Then use **self._build_search_params() in all three methods.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8891c2b and e401a6c.

📒 Files selected for processing (2)
  • athina/steps/llm.py (4 hunks)
  • pyproject.toml (1 hunks)
🔇 Additional comments (2)
pyproject.toml (1)

3-3: LGTM: Appropriate version bump for new features.

The minor version increment correctly reflects the addition of new optional search functionality in the PromptExecution class.

athina/steps/llm.py (1)

284-293: Implementation looks correct with noted asymmetry.

The conditional parameter passing is well-implemented. Note the asymmetric structure where search_mode is top-level while search_context_size is nested under web_search_options - this may be intentional based on the API requirements.

Comment on lines +231 to +232
search_mode: Optional[str] = None
search_context_size: Optional[str] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider type correction and add documentation.

  1. search_context_size should likely be Optional[int] instead of Optional[str] since context size is typically a numeric value.
  2. Missing docstring documentation for the new attributes explaining their purpose and expected values.
-    search_mode: Optional[str] = None
-    search_context_size: Optional[str] = None
+    search_mode: Optional[str] = None
+    search_context_size: Optional[int] = None

Also consider adding docstring documentation:

"""
...existing docstring...

search_mode (Optional[str]): The search mode for web search functionality.
search_context_size (Optional[int]): The context size for search results.
"""
🤖 Prompt for AI Agents
In athina/steps/llm.py around lines 231 to 232, change the type of
search_context_size from Optional[str] to Optional[int] to correctly represent
it as a numeric value. Additionally, update the relevant docstring to include
descriptions for both search_mode and search_context_size, explaining their
purpose and expected types as Optional[str] and Optional[int] respectively.

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.

1 participant