Skip to content

Commit

Permalink
fix: Update LLMEndpoint to include max_tokens parameter (#3201)
Browse files Browse the repository at this point in the history
# Description

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context.

## Checklist before requesting a review

Please delete options that are not relevant.

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented hard-to-understand areas
- [ ] I have ideally added tests that prove my fix is effective or that
my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged

## Screenshots (if appropriate):
  • Loading branch information
StanGirard authored Sep 13, 2024
1 parent 8fb4887 commit 13ed225
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions backend/core/quivr_core/llm/llm_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def from_config(cls, config: LLMEndpointConfig = LLMEndpointConfig()):
if config.llm_api_key
else None,
azure_endpoint=azure_endpoint,
max_tokens=config.max_tokens
)
elif config.model.startswith("claude"):
_llm = ChatAnthropic(
Expand All @@ -50,6 +51,7 @@ def from_config(cls, config: LLMEndpointConfig = LLMEndpointConfig()):
if config.llm_api_key
else None,
base_url=config.llm_base_url,
max_tokens=config.max_tokens
)
else:
_llm = ChatOpenAI(
Expand All @@ -58,6 +60,7 @@ def from_config(cls, config: LLMEndpointConfig = LLMEndpointConfig()):
if config.llm_api_key
else None,
base_url=config.llm_base_url,
max_tokens=config.max_tokens
)
return cls(llm=_llm, llm_config=config)

Expand Down

0 comments on commit 13ed225

Please sign in to comment.