Giter VIP home page Giter VIP logo

Comments (9)

chatanywhere avatar chatanywhere commented on June 30, 2024 1
def main():
    client = OpenAI(
        api_key=gpt.api_key(),
        base_url=gpt.api_base()  # 带v1
    )
    response = client.post(path='/chat/completions', cast_to=dict, body=data)
    print(f'response: {util.json_dump(response)}')

请求的路径是错的,如上修改

from gpt_api_free.

wangluozhuce avatar wangluozhuce commented on June 30, 2024

我也有相同问题。

from gpt_api_free.

cy-zhang98 avatar cy-zhang98 commented on June 30, 2024

俺也一样

from gpt_api_free.

Clemet-Lxw avatar Clemet-Lxw commented on June 30, 2024

俺也一样

from gpt_api_free.

Yanzhanyuyu avatar Yanzhanyuyu commented on June 30, 2024

我也一样,甚至我的免费key有好几个月没用过

from gpt_api_free.

yclinhh avatar yclinhh commented on June 30, 2024

俺也一样

from gpt_api_free.

jiahuiliuuu avatar jiahuiliuuu commented on June 30, 2024

我也

from gpt_api_free.

chatanywhere avatar chatanywhere commented on June 30, 2024

该问题由系统更新后的bug引起,已紧急修复。

from gpt_api_free.

utmhikari avatar utmhikari commented on June 30, 2024

这个复现了?代码:

import gpt
import requests
from openai import OpenAI
import util

headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Bearer {gpt.api_key()}'
}

data = {
    'model': 'gpt-3.5-turbo',
    'messages': [
        {'role': 'user', 'content': '什么是图计算?'}
    ],
    'temperature': 0.7
}


def main():
    client = OpenAI(
        api_key=gpt.api_key(),
        base_url=gpt.api_base()  # 带v1
    )
    response = client.post(path='/completions', cast_to=dict, body=data)
    print(f'response: {util.json_dump(response)}')


if __name__ == '__main__':
    main()

model用的3.5turbo,有报错:

openai.PermissionDeniedError: Error code: 403 - {'error': {'message': '免费API限制使用gpt-3.5-turbo,gpt-4 和 embeddings模型,如有更多需求,请访问 https://buyca.top 购买付费API。The free account is limited to use gpt-3.5-turbo, gpt-4 and embeddings. If you have additional requirements, please visit https://buyca.top to purchase a premium key.', 'type': 'chatanywhere_error', 'param': None, 'code': '403 FORBIDDEN'}}

刚在README用github账号申请的免费key。现在不支持还是?免费key现在能用哪些model?

from gpt_api_free.

Related Issues (20)

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.