poe-platform / fastapi_poe

A helper library for writing Poe API bots using FastAPI
Apache License 2.0
135 stars 25 forks source link

Different bot responses don't appear in next bot queries #64

Closed ibehnam closed 8 months ago

ibehnam commented 8 months ago

I've been following the examples and wanted to see what happens if we use two bots at once like this:

...
        last_message = request.query[-1].content

        if last_message.startswith("search"):
            async for msg in fp.stream_request(
                request,
                "Web-Search",
                request.access_key,
                # tools=tools,
                # tool_executables=tools_executables,
            ):
                yield msg
        else:
            async for msg in fp.stream_request(
                request,
                "GPT-4",
                request.access_key,
                tools=tools,
                tool_executables=tools_executables,
            ):
                yield msg
...

In this example, if the user "searches" something, the result is shown in the chat, but if then the user says "summarize this", GPT-4 doesn't see the search results even though its argument is request.