meistrari / cursive-py Goto Github PK
View Code? Open in Web Editor NEW✦ The intuitive python LLM framework
✦ The intuitive python LLM framework
It will be a great help if cursive-py could support calling async functions (@cursive_function).
The Expected behavior will be the function is called by the LLMs.
Returning res.answer
Error Message:
Traceback (most recent call last):
File "/Users/engineering/git/personal_exploration/main_test.py", line 9, in <module>
def add(a: float, b: float):
File "/Users/engineering/git/personal_exploration/exploration310_env/lib/python3.10/site-packages/cursive/function.py", line 57, in decorator
return CursiveFunction(function, pause=pause)
File "/Users/engineering/git/personal_exploration/exploration310_env/lib/python3.10/site-packages/cursive/function.py", line 17, in __init__
self.definition = function
File "/Users/engineering/git/personal_exploration/exploration310_env/lib/python3.10/site-packages/pydantic/v1/main.py", line 405, in __setattr__
self.__fields_set__.add(name)
AttributeError: 'CursiveFunction' object has no attribute '__fields_set__'. Did you mean: '__fields__'?
Running this part of code:
import os
from cursive import cursive_function, Cursive
cursive = Cursive()
os.environ["OPENAI_API_KEY"] = "<OPENAI-API-KEY>"
@cursive_function()
def add(a: float, b: float):
"""
Adds two numbers.
a: The first number.
b: The second number.
"""
return a + b
res = cursive.ask(
prompt='What is the sum of 232 and 243?',
functions=[add],
)
print({
'model': res.model,
'message': res.answer,
'usage': res.usage.total_tokens,
'convo': res.conversation.messages,
})
Python 3.10.10
MacOS 14 Sonoma
Macbook Pro M2
cursivepy 0.7.0
I follow the instruction for function usage available here : https://github.com/meistrari/cursive-py#functions
Got an error instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.