You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,11 @@
6
6
### Modelsmith is a Python library that allows you to get structured responses in the form of Pydantic models and Python types from Google Vertex AI and OpenAI models.
7
7
8
8
Currently it allows you to use the following classes of model:
9
-
-__OpenAIModel__ (most commonly used with `gpt-3.5-turbo`, `gpt-4` and `gpt-4o`)
10
-
-__VertexAIChatModel__ (most commonly used with `chat-bison`)
11
-
-__VertexAITextGenerationModel__ (most commonly used with `text-bison`)
12
-
-__VertexAIGenerativeModel__ (most commonly used with `gemini-pro`)
9
+
-__AnthropicModel__ (used with Anthropic's set of models such as `claude-3-haiku`, `claude-3-sonnet`, `claude-3-opus` and `claude-3_5-sonnet`)
10
+
-__OpenAIModel__ (used with OpenAI's set of models such as `gpt-3.5-turbo`, `gpt-4` and `gpt-4o`)
11
+
-__VertexAIChatModel__ (used with Google Vertex AI's chat models such as `chat-bison`)
12
+
-__VertexAITextGenerationModel__ (used with Google Vertex AI's text generation models such as `text-bison`)
13
+
-__VertexAIGenerativeModel__ (used with Google Vertex AI's generative models such as `gemini-pro`)
13
14
14
15
Modelsmith provides a unified interface over all of these. It has been designed to be extensible and can adapt to other models in the future.
15
16
@@ -126,10 +127,10 @@ response = forge.generate("I have lived in Irvine, CA and Dallas TX")
If we want to use an OpenAI model the same applies. Simply select the appropriate model class, specify which OpenAI model to use (in this case `gpt-4o`), and pass it to the `Forge` instance.
130
+
If we want to use an Anthropic model the same applies. Simply select the appropriate model class, specify which Anthropic model to use (in this case `claude-3-haiku-20240307`), and pass it to the `Forge` instance.
130
131
131
132
```python
132
-
from modelsmith import Forge, OpenAIModel# import the correct class
133
+
from modelsmith import Forge, AnthropicModel# import the correct class
133
134
from pydantic import BaseModel, Field
134
135
135
136
@@ -138,9 +139,9 @@ class City(BaseModel):
138
139
state: str= Field(description="2-letter abbreviation of the state")
139
140
140
141
141
-
#text-bison instead of gemini-pro
142
+
#Anthropic's claude-3-haiku-20240307 instead of gemini-pro
0 commit comments