Comments (1)
🤖
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:
-
The
prompt
parameter isNone
or an empty string. Theprompt
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. -
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. -
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. -
The
top_k
andtop_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. -
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)
- Add blurb about OpenAI wrapper benefits HOT 1
- PythonSDK: OpenAI dependency HOT 1
- PythonSDK: DevEx HOT 1
- PythonSDK: prompt methods
- PythonSDK: black dependency
- Fix: Pydantic v1 private attribute error
- Update typing dependencies version version contraint HOT 1
- Allow tools, tool_choice, logprobs and top_logprobs for chat completions HOT 1
- Fix: pydantic v2 compatibility for Optional fields HOT 1
- Too strict `mypy` dependency HOT 3
- Allow new embeddings params in python SDK HOT 1
- Bug: Cache Force Refresh not working in python SDK HOT 1
- [Bug]: portkey_ai.api_resources.exceptions.NotFoundError: Error code: 404 - Unable to find requested model. Please confirm that the model exists and you have permission. (Request ID: ) HOT 4
- Update python-sdk README (async) HOT 1
- Revamp Python SDK: Wrapper HOT 1
- [Bug]: ModuleNotFoundError: No module named 'llama_index.llms.anthropic_utils' HOT 4
- Support for Custom Host & Forward Headers HOT 2
- Python: DevEx: Suggestion HOT 1
- PythonSDK Render Method HOT 1
- Fix: build errors due to test cases HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from portkey-python-sdk.