Git Product home page Git Product logo

cursive-py's People

Contributors

altryne avatar cyrusofeden avatar guiqft avatar henrycunh avatar rgbkrk avatar rodrigo-lg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cursive-py's Issues

Error while using Cursive Function Usage

Expected Behavior

The Expected behavior will be the function is called by the LLMs.

Returning res.answer

Current Behavior

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__'?

Steps to Reproduce

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,
    })

Context (Environment)

Python 3.10.10
MacOS 14 Sonoma
Macbook Pro M2
cursivepy 0.7.0

Detailed Description

I follow the instruction for function usage available here : https://github.com/meistrari/cursive-py#functions
Got an error instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.