sugarforever / langchain-advanced Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'm generating an openai api format link for wizardcoder-13b to use in autogen with support for downloading various documents, but your google collab notebook doesn't accept it.
---------------------------------------------------------------------------
AuthenticationError Traceback (most recent call last)
[<ipython-input-24-85f187986a5e>](https://localhost:8080/#) in <cell line: 5>()
3 embedding_function=OpenAIEmbeddings()
4 )
----> 5 vectorstore.add_documents(docs)
16 frames
[/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py](https://localhost:8080/#) in _interpret_response_line(self, rbody, rcode, rheaders, stream)
773 stream_error = stream and "error" in resp.data
774 if stream_error or not 200 <= rcode < 300:
--> 775 raise self.handle_error_response(
776 rbody, rcode, resp.data, rheaders, stream_error=stream_error
777 )
AuthenticationError: Incorrect API key provided: https://************************************************.com. You can find your API key at https://platform.openai.com/account/api-keys.
Is there anything I can do about it? (+ if you know another way to generate OpenAI API format link, I would be very grateful if you could share it). Also if the error isn't in the link, I can assume it's in the way I'm uploading it (I edited the code a bit):
import autogen
import os
config_list = [
{
"model": "mistral-7b",
"api_key": "https://brothers-chip-training-potentially.trycloudflare.com", # - This is roughly what the links I generate look like (regular autogen accepts them and works fine, but I need document support)
},
]
gpt4_api_key = "https://brothers-chip-training-potentially.trycloudflare.com"
os.environ['OPENAI_API_KEY'] = gpt4_api_key
Once again, I would like to point out that normal autogen accepts and works with this link, but with LangChain it does not allow it for some reason.
!pip install -U -q "langchain==0.0.331rc2" langchain-experimental "openai>=1.1"
from langchain_experimental.openai_assistant import OpenAIAssistantRunnable
According to the latest doc:
https://python.langchain.com/docs/modules/agents/agent_types/openai_assistants#using-only-openai-tools, you could use:
!pip install -U -q langchain langchain-experimental "openai>=1.1"
from langchain.agents.openai_assistant import OpenAIAssistantRunnable
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.