Skip to content
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

multiple: add stop attribute #22573

Merged
merged 8 commits into from
Jun 6, 2024
Merged

multiple: add stop attribute #22573

merged 8 commits into from
Jun 6, 2024

Conversation

ccurme
Copy link
Collaborator

@ccurme ccurme commented Jun 5, 2024

No description provided.

@efriis efriis added the partner label Jun 5, 2024
@efriis efriis self-assigned this Jun 5, 2024
Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Jun 6, 2024 2:35pm

@ccurme ccurme changed the title (WIP) multiple: add stop attribute multiple: add stop attribute Jun 6, 2024
@ccurme ccurme marked this pull request as ready for review June 6, 2024 14:48
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. 🤖:improvement Medium size change to existing code to handle new use-cases labels Jun 6, 2024
@@ -97,6 +99,8 @@ def _default_params(self) -> Mapping[str, Any]:
"top_k_return": self.top_k_return,
"n": self.n,
}
if self.stop:
base_params["stop_sequences"] = self.stop
Copy link
Collaborator

Choose a reason for hiding this comment

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

unrelated but the check in L126 doesn't do anything, it couldn't be in kwargs

@@ -492,6 +492,9 @@ class Config:
max_retries: int = 2
"""Number of retries allowed for requests sent to the Anthropic Completion API."""

stop: Optional[List[str]] = Field(None, alias="stop_sequences")
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we make the attribute stop_sequences and the alias stop? since stop_sequences is the Anthropic name for it

@@ -35,6 +35,8 @@ class ChatAI21(BaseChatModel, AI21Base):
You can view the options at https://github.com/AI21Labs/ai21-python?tab=readme-ov-file#model-types"""
num_results: int = 1
"""The number of responses to generate for a given prompt."""
stop: Optional[List[str]] = None
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment about making this stop_sequences and alias stop

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

missed your comments, will add in another PR

@ccurme ccurme merged commit 3999761 into master Jun 6, 2024
111 of 117 checks passed
@ccurme ccurme deleted the cc/add_stop_as_attribute branch June 6, 2024 16:11
hinthornw pushed a commit that referenced this pull request Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:improvement Medium size change to existing code to handle new use-cases partner size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants