Skip to content

Commit

Permalink
Override default max tokens for Anthropic and Groq clients
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalef committed Sep 22, 2024
1 parent 73feb3c commit ecfc45f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion graphiti_core/llm_client/anthropic_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def __init__(self, config: LLMConfig | None = None, cache: bool = False):
super().__init__(config, cache)

# Override the default max tokens for Anthropic
self.max_tokens = DEFAULT_MAX_TOKENS
if self.max_tokens is None:
self.max_tokens = DEFAULT_MAX_TOKENS

self.client = AsyncAnthropic(
api_key=config.api_key,
Expand Down
3 changes: 2 additions & 1 deletion graphiti_core/llm_client/groq_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def __init__(self, config: LLMConfig | None = None, cache: bool = False):
super().__init__(config, cache)

# Override the default max tokens for Groq
self.max_tokens = DEFAULT_MAX_TOKENS
if self.max_tokens is None:
self.max_tokens = DEFAULT_MAX_TOKENS

self.client = AsyncGroq(api_key=config.api_key)

Expand Down

0 comments on commit ecfc45f

Please sign in to comment.