Giter VIP home page Giter VIP logo

lexicaapi's Introduction

lexicaapi's People

Contributors

qewertyy avatar

Stargazers

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

Watchers

 avatar  avatar

lexicaapi's Issues

bard responce

when i try to call bard , the folowing error show up :
Traceback (most recent call last):
File "e:\FILES\Documents\Web-Dev-Project\Chat-Bot\api\brain.py", line 87, in
print(main("hello, who are you?"))
File "e:\FILES\Documents\Web-Dev-Project\Chat-Bot\api\brain.py", line 83, in main
response = client.ChatCompletion(prompt,languageModels.bard)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\lexica\core.py", line 76, in ChatCompletion
resp = self._request(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\lexica\core.py", line 40, in _request
raise Exception(f"API error {response.text}")
Exception: API error

<title>lexica.qewertyy.me | 502: Bad gateway</title>

Bad gateway Error code 502

Visit cloudflare.com for more information.
2023-12-05 02:41:24 UTC
<span class="cf-icon-browser block md:hidden h-20 bg-center bg-no-repeat"></span>
<span class="cf-icon-ok w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span>
You

Browser

Working
Madrid

Cloudflare

Working
<span class="cf-icon-server block md:hidden h-20 bg-center bg-no-repeat"></span>
<span class="cf-icon-error w-12 h-12 absolute left-1/2 md:left-auto md:right-0 md:top-0 -ml-6 -bottom-4"></span>
lexica.qewertyy.me

Host

Error
            </div>
        </div>
    </div>

    <div class="w-240 lg:w-full mx-auto mb-8 lg:px-8">
        <div class="clearfix">
            <div class="w-1/2 md:w-full float-left pr-6 md:pb-10 md:pr-0 leading-relaxed">
                <h2 class="text-3xl font-normal leading-1.3 mb-4">What happened?</h2>
                <p>The web server reported a bad gateway error.</p>
            </div>
            <div class="w-1/2 md:w-full float-left leading-relaxed">
                <h2 class="text-3xl font-normal leading-1.3 mb-4">What can I do?</h2>
                <p class="mb-6">Please try again in a few minutes.</p>
            </div>
        </div>
    </div>

    <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">

Cloudflare Ray ID: 8308ee0c0ed02f80 โ€ข Your IP: Click to reveal 196.113.111.93 โ€ข Performance & security by Cloudflare

<script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script>
</div>

i think that google maked some changes in the website

Suggetion

Try raising an error when a method cannot run successfully, for example, when encountering a 'RequestFailed' situation. Another convenient approach could be to provide an error code and message when a request fails, like this: {'code': 400, 'message': 'This service is currently unavailable.'} I know you have already implemented this in the API, but it serves as a backup in case the API experiences downtime.

My suggestion is to raise an error when needed, as you already have the 'code' and 'message' available in the API

bard response

Bard feature returne the folowimg value :

  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\lexica\core.py", line 76, in ChatCompletion 
    resp = self._request(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\lexica\core.py", line 40, in _request       
    raise Exception(f"API error {response.text}")
Exception: API error {"message":"Internal Server Error","code":0}

generate response issue

error code :

File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\lexica\core.py", line 45, in _request
raise Exception(f"API error {response.text}")
Exception: API error {"message":"Internal Server Error","code":0}

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.