- clarifai
- coding-template
code-completion
This help to predict and suggest possible code completions based on the previous context, you just need to input previous context code and coding LLMs can
Notes
Code Completion and Auto-Suggestion
Coding LLMs can predict and suggest code completions that can assist developers by providing context-aware code completions as they type, reducing the need to memorize syntax and API specifications. This feature is particularly useful for accelerating coding tasks and reducing errors.
Code Completion Workflow
This workflow help to predict and suggest possible code completions based on the previous context, you just need to input previous context code and coding LLMs can predict and suggest code completions.
Model used
This workflow uses the deepseek-coder-33b-instruct Model with defined prompt template optimized for code completion.
How to use the Code Completion workflow?
Using Clarifai SDK
Export your PAT as an environment variable. Then, import and initialize the API Client.
Find your PAT in your security settings.
export CLARIFAI_PAT={your personal access token}
Prediction with the workflow
from clarifai.client.workflow import Workflow
workflow_url = 'https://clarifai.com/{{user_id}}/coding-template/workflows/code-completion'
text = 'function generateRandomNumber(min, max) {'
prediction = Workflow(workflow_url).predict_by_bytes( text.encode(), input_type="text")
# Get workflow results
print(prediction.results[0].outputs[-1].data.text.raw)
Using Workflow
To utilize the Code Completion workflow, you can input previous context code or partial code through the Blue Plus Try your own Input button and it will predict and suggest code completions.
- Workflow IDcode-completion
- DescriptionThis help to predict and suggest possible code completions based on the previous context, you just need to input previous context code and coding LLMs can predict and suggest code completions
- Last UpdatedMay 20, 2024
- PrivacyPUBLIC
- Share