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
I have tried asking for help in the community on discord or discussions and have not received a response.
I have tried searching the documentation and have not found an answer.
What Model are you using?
gpt-3.5-turbo
gpt-4-turbo
gpt-4
Other (please specify): Bedrock-powered us.meta.llama3-1-70b-instruct-v1:0
Describe the bug
[Instructor's example code (from the documentation page) to create a client using the from_litellm method doesn't run
Code:
fromlitellmimportcompletionimportinstructorfrompydanticimportBaseModel# Enable instructor patchesclient=instructor.from_litellm(completion)
classUser(BaseModel):
name: strage: int# Create structured outputuser=client.completion(
model="gpt-3.5-turbo", # Can use any supported modelmessages=[
{"role": "user", "content": "Extract: Jason is 25 years old"},
],
response_model=User,
)
print(user) # User(name='Jason', age=25)
Output: AttributeError: 'NoneType' object has no attribute 'completion'
Replacing the invocation method from "completion" to "messages.create" also does not work, as it yields an error of Unsupported Parameters even if the model has support for tools, i.e.
Code:
fromlitellmimportcompletionimportinstructorfrompydanticimportBaseModelimportlitellmclient=instructor.from_litellm(completion)
classUser(BaseModel):
name: strage: intlitellm.supports_function_calling('us.meta.llama3-1-70b-instruct-v1:0')
client.messages.create(
model="us.meta.llama3-1-70b-instruct-v1:0",
messages=[
{"content": "Hello, how are you?","role": "user"},
],
response_model=User,
)
What Model are you using?
Describe the bug
[Instructor's example code (from the documentation page) to create a client using the from_litellm method doesn't run
Code:
Output:
AttributeError: 'NoneType' object has no attribute 'completion'
Replacing the invocation method from "completion" to "messages.create" also does not work, as it yields an error of Unsupported Parameters even if the model has support for tools, i.e.
Code:
Output:
Note that simple function calling works fine for these models on LiteLLM standalone:
Code:
To Reproduce
Code:
Expected behavior
Output:
The text was updated successfully, but these errors were encountered: