Giter Club home page Giter Club logo

Comments (7)

Vinlic avatar Vinlic commented on June 28, 2024

@YP1X
I confirm that the service is working normally, please check whether your token is wrong.

from kimi-free-api.

YP1X avatar YP1X commented on June 28, 2024

Error: Not found because of proxy error: Error: Client network socket disconnected before secure TLS connection was established (Status Code: 404)
I believe token is right this time.

from kimi-free-api.

YP1X avatar YP1X commented on June 28, 2024

I am using botpress cloud platform to build bots.

from kimi-free-api.

Vinlic avatar Vinlic commented on June 28, 2024

@YP1X Can you provide a screenshot of the container log of kimi-free-api? I connected through Dify and found no problem.

from kimi-free-api.

YP1X avatar YP1X commented on June 28, 2024

404 didn't reoccur. I am not a dev so maybe it's a coding problem.
code:

const kimi_API_KEY = env.kimiFreeKey;

const data = {
    // 模型名称随意填写,如果不希望输出检索过程模型名称请包含silent_search
    "model": "kimi",
    "messages": [
        {
            "role": "user",
            "content": `${workflow.message}`
        }
    ],
    // 是否开启联网搜索,默认false
    "use_search": true,
    // 如果使用SSE流请设置为true,默认false
    "stream": false
}

async function getKimiMessage() {
  try {
    const response = await axios.post('https://api.moonshot.cn/v1/chat/completions', data, {
      headers: {
        Authorization: `Bearer ${kimi_API_KEY}`,
        'Content-Type': 'application/json',
      },
    });

    workflow.response = response.data.choices[0].message.content;
    return workflow.response;
  } catch (error) {
    console.error(error);
    throw error;
  }
}

await getKimiMessage()
  .then((message) => {
    console.log('Kimi message:', message);
  })
  .catch((error) => {
    console.error('Error:', error);
  });

Screenshot (1150)

from kimi-free-api.

Vinlic avatar Vinlic commented on June 28, 2024

@YP1X You may have mistaken the function of kimi-free-api. This is not the official API channel of kimi moonshot ai, but reverses the kimi.ai page function and converts it into an API interface compatible with openai. If you want to use the official moonshot ai interface, please go to https://platform.moonshot.cn/. If you want to use kimi-free-api, please deploy the service yourself and change the proxy address and port, and then change API_KEY to refresh_token.

from kimi-free-api.

YP1X avatar YP1X commented on June 28, 2024

I may try Dify. THX for your note.

from kimi-free-api.

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.