Comments (4)
I've just resolved this. You can update the lib now.
from poe-api-wrapper.
can you specify what files you uploaded?
and the code you used here?
from poe-api-wrapper.
File upload: info.txt
Code:
import getDuckDuckRegion
from poe_api_wrapper import PoeApi
m_b = '....'
def search(engine, prompt, id=''):
region = getDuckDuckRegion(prompt)
if (prompt.strip()).startswith('#search:'):
keywords = [prompt.replace('#search:', '')]
act = keywords
else:
prompt = prompt.split('#search:')
keywords = prompt[1].strip().split('\n')
act = prompt[0]
count = 15
if len(keywords) > 1: count = 5
ddg = ddgSearch(keywords=keywords, region=region, count=count)
i = 1
links = ''
for url in ddg['urls']:
links = links + f'[{i}] {url}\n'
i = i + 1
documents = ' '.join(ddg['documents'])
temp_path = f'{getConfPath()}{os.sep}info.txt'
if os.path.exists(temp_path): os.remove(temp_path)
prompt = f'{prompt}#file::{temp_path}'
return poeChat(prompt, engine, id)
def poeChat(prompt, engine='', id=''):
file_path = []
if '#file::' in prompt:
file_path = prompt.split('#file::')[1].strip()
file_path = file_path.split('\n')
prompt = prompt.split('#file::')[0]
client = PoeApi(m_b)
if id !='':
id = id.split(' ')
response = client.send_message('gpt3_5', prompt, chatCode=id[0], chatId=int(id[1]), file_path=file_path)
else:
response = client.send_message('gpt3_5', prompt, file_path=file_path)
for chunk in response:
pass
chatCode = chunk["chatCode"]
chatId = chunk["chatId"]
return {'RESULT': True, 'ID': f'{chatCode} {chatId}', 'DATA': chunk['text']}
It run smooth if not attach file
from poe-api-wrapper.
Yeah i am facing the same error too when i try to upload file
from poe-api-wrapper.
Related Issues (20)
- I am getting an error when running the following commands. Maybe I'm not installing it correctly. I have Python 3.12.1 HOT 11
- Bot is not available HOT 2
- client.purge_conversation count doesn't work properly
- About the package with Python call problem HOT 1
- An error occurred: Bot chinchilla not found. Make sure the bot exists before creating new chat. HOT 2
- Can't get response anymore - API broken? HOT 12
- Cancelling message returns an error HOT 2
- I don't know how to use
- httpcore.ConnectError: [WinError 10054] | Proxy Error HOT 1
- Will there be an Async version of the Library? HOT 1
- Failed to extract the form key HOT 3
- Add gemini pro in poe-api-wrapper HOT 1
- chat_break not clearing context HOT 2
- Rate limit exceeded for sending requests to poe.com. Please try again later. HOT 7
- Rate limit exceeded for sending requests to poe.com. HOT 9
- No WAY To send a message to a non default bot.
- Is there a way to grab output message citation content ? HOT 4
- get_available_knowledge is limited to the 5 last entries HOT 1
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poe-api-wrapper.