Coder Social home page Coder Social logo

Comments (1)

dosubot avatar dosubot commented on June 15, 2024 2

🤖

Hey @ayush-portkey! 😊

I'm Dosu, a friendly bot here to lend a hand with bugs, answer inquiries, and guide you on your journey to becoming a contributor! While you're waiting for a human maintainer, I'm here to help. 🦾

Based on the information you've provided, there could be several reasons why the prompts.complete function is not generating completions as expected. Here are a few possibilities:

  1. The prompt parameter is None or an empty string. The prompt is the input text that you want the AI to complete. If it's not provided or empty, the AI might not know what to generate.

  2. The max_tokens parameter is set to a very low value. This parameter controls the maximum length of the generated text. If it's too low, the AI might not generate any text.

  3. The temperature parameter is set to a very low value. This parameter controls the randomness of the generated text. If it's too low, the AI might always generate the same text.

  4. The top_k and top_p parameters are set to very low values. These parameters control the diversity of the generated text. If they're too low, the AI might not generate diverse text.

  5. There might be an issue with the connection to the Portkey API. Check if the API is up and running and if your API key is valid.

Here's the relevant code:

def create(
        self,
        *,
        prompt: Optional[str] = None,
        stream: bool = False,
        temperature: Optional[float] = None,
        max_tokens: Optional[int] = None,
        top_k: Optional[int] = None,
        top_p: Optional[float] = None,
        **kwargs,
    ) -> Union[TextCompletion, Stream[TextCompletionChunk]]:
        body = dict(
            prompt=prompt,
            temperature=temperature,
            max_tokens=max_tokens,
            top_k=top_k,
            top_p=top_p,
            stream=stream,
            **kwargs,
        )
        return self._post(
            PortkeyApiPaths.TEXT_COMPLETE_API,
            body=body,
            params=None,
            cast_to=TextCompletion,
            stream_cls=Stream[TextCompletionChunk],
            stream=stream,
            headers={},
        )

You can find this code in the portkey_ai/api_resources/apis/complete.py file.

If you're still experiencing issues, could you please provide more details? Specifically, it would be helpful to know the exact error message or behavior you're experiencing when trying to use the prompts.complete function. Also, please let us know the exact parameters you're passing to the function. This will help us better understand the issue and provide a more accurate solution.

Sources


This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

from portkey-python-sdk.

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.