Skip to content

Commit

Permalink
Merge pull request #341 from idvorkin/support-claude-3-5-sonnet-20241022
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD authored Oct 29, 2024
2 parents a80e0b1 + 19c12dd commit ceacdbb
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,4 @@ dist
static/
*.db-shm
*.db-wal
.aider*
2 changes: 1 addition & 1 deletion docs/src/core_concepts/tool_usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ This is accomplished by a language model program that takes the source code of a
.. code-block:: python
@ell.simple(model="claude-3-5-sonnet", temperature=0.0)
@ell.simple(model="claude-3-5-sonnet-20241022", temperature=0.0)
def generate_tool_spec(tool_source: str):
'''
You are a helpful assistant that takes in source code for a python function and produces a JSON schema for the function.
Expand Down
2 changes: 1 addition & 1 deletion examples/claude.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ell # type: ignore

@ell.simple(model="claude-3-5-sonnet-20240620", max_tokens=100)
@ell.simple(model="claude-3-5-sonnet-20241022", max_tokens=100)
def hello_from_claude():
"""You are an AI assistant. Your task is to respond to the user's message with a friendly greeting."""
return "Say hello to the world!!!"
Expand Down
2 changes: 1 addition & 1 deletion examples/future/multimodal_tool_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_ice_cream_flavors():
return to_content_blocks([("1. Vanilla"), "2.", (generate_strawberry_image()), ("3. Coconut")])


@ell.complex(model="claude-3-5-sonnet-20240620", tools=[get_user_name, get_ice_cream_flavors], max_tokens=1000)
@ell.complex(model="claude-3-5-sonnet-20241022", tools=[get_user_name, get_ice_cream_flavors], max_tokens=1000)
def f(message_history: list[ell.Message]) -> list[ell.Message]:
return [
ell.system(
Expand Down
2 changes: 1 addition & 1 deletion examples/future/tool_using_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def approve_claim(claim_id : str):
"""Approve a claim"""
return "approved"

@ell.complex(model="claude-3-5-sonnet-20240620", tools=[create_claim_draft, approve_claim], temperature=0.1, max_tokens=400)
@ell.complex(model="claude-3-5-sonnet-20241022", tools=[create_claim_draft, approve_claim], temperature=0.1, max_tokens=400)
def insurance_claim_chatbot(message_history: List[Message]) -> List[Message]:
return [
ell.system( """You are a an insurance adjuster AI. You are given a dialogue with a user and have access to various tools to effectuate the insurance claim adjustment process. Ask question until you have enough information to create a claim draft. Then ask for approval."""),
Expand Down
2 changes: 1 addition & 1 deletion examples/future/use_tool_once.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_html_content(
return soup.get_text()[:100]


@ell.complex(model="claude-3-5-sonnet-20240620", tools=[get_html_content], max_tokens=200)
@ell.complex(model="claude-3-5-sonnet-20241022", tools=[get_html_content], max_tokens=200)
def summarize_website(website :str) -> str:
"""You are an agent that can summarize the contents of a website."""
return f"Tell me whats on {website}"
Expand Down
4 changes: 2 additions & 2 deletions examples/providers/anthropic_ex.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# custom client
client = anthropic.Anthropic()

@ell.simple(model='claude-3-5-sonnet-20240620', client=client, max_tokens=10)
@ell.simple(model='claude-3-5-sonnet-20241022', client=client, max_tokens=10)
def chat(prompt: str) -> str:
return prompt

print(chat("Hello, how are you?"))

# Models are automatically registered!
@ell.simple(model='claude-3-5-sonnet-20240620', max_tokens=10)
@ell.simple(model='claude-3-5-sonnet-20241022', max_tokens=10)
def use_default_client(prompt: str) -> str:
return prompt

Expand Down
2 changes: 2 additions & 0 deletions src/ell/models/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def register(client: anthropic.Anthropic):
('claude-3-sonnet-20240229', 'anthropic'),
('claude-3-haiku-20240307', 'anthropic'),
('claude-3-5-sonnet-20240620', 'anthropic'),
('claude-3-5-sonnet-20241022', 'anthropic'),
('claude-3-5-sonnet-latest', 'anthropic'),
]
for model_id, owned_by in model_data:
config.register_model(model_id, client)
Expand Down

0 comments on commit ceacdbb

Please sign in to comment.