Giter VIP home page Giter VIP logo

Comments (5)

pplonski avatar pplonski commented on May 17, 2024

Hi @augustocrmg,

You need to change the model in this line

model = "gpt-3.5-turbo"

to setup GPT4. I prefered GPT 3.5 because it is faster and cheaper.

from plotai.

augustocrmg avatar augustocrmg commented on May 17, 2024

When i try to use this code from your examples:

df = pd.DataFrame({"x":[1,2,3], "y": [4,5,6]}) plot = PlotAI(df,model=llm.engine)

i obtain this error, note that i tested the key with another call and its valid:

`
InvalidRequestError Traceback (most recent call last)
File /anaconda/envs/gpt_develop/lib/python3.10/site-packages/plotai/plotai.py:43, in PlotAI.make(self, prompt)
39 p = Prompt(prompt, self.df, self.x, self.y, self.z)
41 Logger().log({"title": "Prompt", "details": p.value})
---> 43 response = ChatGPT().chat(p.value)
45 Logger().log({"title": "Response", "details": response})
47 executor = Executor()

File /anaconda/envs/gpt_develop/lib/python3.10/site-packages/plotai/llm/openai.py:48, in ChatGPT.chat(self, prompt)
37 def chat(self, prompt):
39 params = {
40 **self._default_params,
41 "messages": [
(...)
46 ],
47 }
---> 48 response = openai.ChatCompletion.create(**params)
49 return response["choices"][0]["message"]["content"]

File /anaconda/envs/gpt_develop/lib/python3.10/site-packages/openai/api_resources/chat_completion.py:25, in ChatCompletion.create(cls, *args, **kwargs)
23 while True:
24 try:
---> 25 return super().create(*args, **kwargs)
26 except TryAgain as e:
27 if timeout is not None and time.time() > start + timeout:

File /anaconda/envs/gpt_develop/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py:149, in EngineAPIResource.create(cls, api_key, api_base, api_type, request_id, api_version, organization, **params)
127 @classmethod
128 def create(
129 cls,
(...)
136 **params,
137 ):
138 (
139 deployment_id,
140 engine,
141 timeout,
142 stream,
143 headers,
144 request_timeout,
145 typed_api_type,
146 requestor,
147 url,
148 params,
--> 149 ) = cls.__prepare_create_request(
150 api_key, api_base, api_type, api_version, organization, **params
151 )
153 response, _, api_key = requestor.request(
154 "post",
155 url,
(...)
160 request_timeout=request_timeout,
161 )
163 if stream:
164 # must be an iterator

File /anaconda/envs/gpt_develop/lib/python3.10/site-packages/openai/api_resources/abstract/engine_api_resource.py:83, in EngineAPIResource.__prepare_create_request(cls, api_key, api_base, api_type, api_version, organization, **params)
81 if typed_api_type in (util.ApiType.AZURE, util.ApiType.AZURE_AD):
82 if deployment_id is None and engine is None:
---> 83 raise error.InvalidRequestError(
84 "Must provide an 'engine' or 'deployment_id' parameter to create a %s"
85 % cls,
86 "engine",
87 )
88 else:
89 if model is None and engine is None:

InvalidRequestError: Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>
`

from plotai.

augustocrmg avatar augustocrmg commented on May 17, 2024

I belive that with the update to GPT4 it is necessary to use these parameters, is there any way for me to use them with plotai ?

from plotai.

pplonski avatar pplonski commented on May 17, 2024

Hi @augustocrmg,

we need to change PlotAI contructor to accept model argument. Would you like to provide PR?

from plotai.

augustocrmg avatar augustocrmg commented on May 17, 2024

Yes i can do it, and i had some other ploblems with the deployment id that needs to be passed when development is being carried out on azure plataforms, i will add this in the pull request too

from plotai.

Related Issues (2)

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.