package
stringlengths 1
122
| pacakge-description
stringlengths 0
1.3M
|
---|---|
aibase | 简介提供基础方法调用,规范代码风格结构介绍aibase
common # 通用
middleware # 中间件相关
utils # 工具
README.md # 说明文档
setup.py # 构建打包上传环境安装python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade twine打包python setup.py sdist bdist_wheel上传python -m twine upload dist/* |
aibasics | AI UncoveredAI Uncovered: A Comprehensive Guide to AI Basics and ApplicationsDocumentation:https://aibasics.halla.aiGitHub:https://github.com/chu-aie/aibasicsPyPI:https://pypi.org/project/aibasicsAI Uncovered is a 15-week, beginner-friendly course in Korean, designed to provide a comprehensive introduction to artificial intelligence (AI) and its real-world applications. Students will explore various AI concepts and techniques, such as machine learning, deep learning, natural language processing, and object detection. The course includes hands-on lab sessions using Google Colab, allowing students to practice what they've learned. By the end, students will have a solid understanding of AI fundamentals and be prepared for an AI-driven future.ChangelogSee theCHANGELOGfor more information.ContributingContributions are welcome! Please see thecontributing guidelinesfor more information.LicenseThis project is released under theCC-BY-4.0 License. |
aib-custom-logger | Example PackageThis is a simple example package. You can useGithub-flavored Markdownto write your content. |
aib-custom-logger-tst | Example PackageThis is a simple example package. You can useGithub-flavored Markdownto write your content. |
aib-custom-logging-test | aib_custom_loggerThis serves as the official documentation for the PyPi package developed by the AIB MLOPS team called "aib-custom-logger".IntroductionThe "aib-custom-logger" pypi pkg offers the abilty to throw logs that contains meaningful metadata, which can be used in both debugging and monitoring.UsageThe pkg exists in the aib-mirror, once you install the pkg using "pip install aib-custom-logger", you can proceed to use it as follows:from aib_custom_logger_tst.aib_custom_logger import aib_logger
my_logger=aib_logger(project_id,pipeline_name="{{$.pipeline_job_name}}")
my_logger.log(
f"Batch prediction job output info: {job.output_info}",
category=aib_logger.Categories.DATA,
action=aib_logger.Actions.CREATE,
extra_labels=['batch_prediction','automl']
)1.init()After you import the pkg you need to initialise an object of the aib_logger class. The constructor takes the following params:project (str):Required. The project id of to add to the google cloud client for logging.pipeline_name (str):Optional. The pipeline run name that this log was thrown from. This can be achieved by passing the placeholder "{{$.pipeline_job_name}}" which will be replaced by the run_name at run time. Default is empty string "".logger_name (str):Optional. The name of the custom logger which you can then query by. Default is "aib_custom_logger".2.Log()the log function takes the following params:msg (str):Required. The content you wish to log.category (aib_logger.Categories):Optional. An enum to choose from relating the category of the log. Default is "Other".action (aib_logger.Actions):Optional. An enum to choose from relating the action of the log. Default is "Other".severity (aib_logger.Severities):Optional. An enum to choose from relating the level of severity of the log. Default is "Info".extra_labels (list):Optional. Extra custom labels to add to the log.object (dict):Optional. An extra custom dictionary to be added.3.CategoriesThe following are the available categories (key=value) defined in the aib_logger.Categories enum:MODEL = "Model"DATA = "Data"METRIC = "Metric"OTHER = "Other"4.ActionsThe following are the available actions (key=value) defined in the aib_logger.Actions enum:CREATE="Create"UPDATE="Update"DELETE="Delete"UPLOAD="Upload"OTHER="Other"5.SeveritiesThe following are the available severities (key=value) defined in the aib_logger.Severities enum:INFO="INFO"WARNING="WARNING"ERROR="ERROR"QueryingIn order to see the logs being produced by your pipeline, you need to navigate to the logging page in GCP and start querying.logname:you can query for all the logs that were produced by a specific custom logger name.jsonpayload:the jsonpayload holds the content of your logs and the metadata. It is a key value object as seen below.LimitationsCurrently the custom logs yielded by this pkg can only appear in the logging page, and not the logs section in the vertex pipelines UI. |
aibekpdf | No description available on PyPI. |
aibench | AIBenchmarkBenchmark your model against other modelsAbout|Features|Technologies|Starting|License|AuthorInstallationRun this script in your terminal:$pipinstallaibenchAboutAIBenchmark is a package which lets you quickly get the benchmark of your model based on the popular datasets and compare with existing leaderboard. It also has a nice collection of metrics which you could easily import.We currently support 14 text-based and 2 image-based datasets for AutoBenchmarking aiming for regression/classification tasks. Available datasets could be found in aibenchmark/dataset.py file.Or run the following code:fromaibenchmark.datasetimportDatasetsListprint(list(DatasetsList.get_available_datasets()))Code example for benchmarking:fromaibenchmark.benchmarkimportBenchmarkfromaibenchmark.datasetimportDatasetInfo,DatasetsListbenchmark=Benchmark(DatasetsList.Texts.SST)dataset_info:DatasetInfo=benchmark.dataset_infoprint(dataset_info)test_features=dataset_info.data['Texts']model=torch.load(...)# Implement your code based on the type of model you use, your pre- and post-processing etc.outputs=model.predict(test_features)# Results of your model based on predictionsbenchmark_results=benchmark.run(predictions=outputs,metrics=['accuracy','precision','recall','f1_score'])# Metricsprint(benchmark_results)# Existing leaderboard for this datasetprint(benchmark.get_existing_benchmarks())FeaturesFast comparison of metrics of your model and other SOTA models for particular datasetSupporting 16+ most populat datasets, the list is always updating. Soon we willl support more than 1000 datasetsAll metrics in one place and we are adding new ones in a standardised wayTechnologiesThe following tools were used in this project:PytorchTransformersScikit-learn:memo: LicenseThis project is under license from MIT. For more details, see theLICENSEfile.Made byIgorandTimBack to top |
ai-benchmark | AI Benchmark Alphais an open source python library for evaluating AI performance of various hardware platforms, including CPUs, GPUs and TPUs. The benchmark is relying onTensorFlowmachine learning library, and is providing a lightweight and accurate solution for assessing inference and training speed for key Deep Learning models.In total, AI Benchmark consists of42 testsand19 sectionsprovided below:MobileNet-V2[classification]Inception-V3[classification]Inception-V4[classification]Inception-ResNet-V2[classification]ResNet-V2-50[classification]ResNet-V2-152[classification]VGG-16[classification]SRCNN 9-5-5[image-to-image mapping]VGG-19[image-to-image mapping]ResNet-SRGAN[image-to-image mapping]ResNet-DPED[image-to-image mapping]U-Net[image-to-image mapping]Nvidia-SPADE[image-to-image mapping]ICNet[image segmentation]PSPNet[image segmentation]DeepLab[image segmentation]Pixel-RNN[inpainting]LSTM[sentence sentiment analysis]GNMT[text translation]For more information and results, please visit the project website:http://ai-benchmark.com/alphaInstallation InstructionsThe benchmark requires TensorFlow machine learning library to be present in your system.On systems thatdo not have Nvidia GPUs, run the following commands to install AI Benchmark:pipinstalltensorflow
pipinstallai-benchmarkIf you want to check theperformance of Nvidia graphic cards, run the following commands:pipinstalltensorflow-gpu
pipinstallai-benchmarkNote 1:If Tensorflow is already installed in your system, you can skip the first command.Note 2:For running the benchmark on Nvidia GPUs,NVIDIA CUDAandcuDNNlibraries should be installed first. Please find detailed instructionshere.Getting StartedTo run AI Benchmark, use the following code:fromai_benchmarkimportAIBenchmarkbenchmark=AIBenchmark()results=benchmark.run()Alternatively, on Linux systems you can typeai-benchmarkin the command line to start the tests.To run inference or training only, usebenchmark.run_inference()orbenchmark.run_training().Advanced settingsAIBenchmark(use_CPU=None,verbose_level=1):use_CPU={True, False, None}: whether to run the tests on CPUs (if tensorflow-gpu is installed)verbose_level={0, 1, 2, 3}: run tests silently | with short summary | with information about each run | with TF logsbenchmark.run(precision="normal"):precision={"normal", "high"}: ifhighis selected, the benchmark will execute 10 times more runs for each test.Additional Notes and RequirementsGPU with at least 2GB of RAM is required for running inference tests / 4GB of RAM for training tests.The benchmark is compatible with bothTensorFlow 1.xand2.xversions.ContactsPlease [email protected] any feedback or information. |
ai-bias-detect | No description available on PyPI. |
aiblocks | Failed to fetch description. HTTP Status Code: 404 |
aib-logging | aib_custom_logging |
aibloks | Failed to fetch description. HTTP Status Code: 404 |
aibo | 🔈AiboOffline Smart Speaker Engine Powered by ChatGPThttps://user-images.githubusercontent.com/62988216/228871916-f8311a31-be59-4855-b7d9-873e3f9adc10.movFeaturesVoice Prompting: You and Aibo can communicate by voice.Security and Privacy: You don't need to worry about security and privacy.Models: You can choose your favorite AI model as your aibo.InstallationWith pipThis repository is tested on Python 3.8+, PyTorch 1.13.1+ and MacOS 11.5.2+.You should install aibo in avirtual environment. If you're unfamiliar with Python virtual environments, check out theuser guide.First, create a virtual environment with the version of Python you're going to use and activate it.Then, you will need to install PyTorch.
Please refer toPyTorch installation pageregarding the specific installation command for your platform.When one of those backends has been installed, aibo can be installed using pip as follows:pipinstallaiboUsageFirst, configure the model you want to use, API, and API key. You can also set the parameters required for online execution at this point.aiboinitStart aibo and start conversation in your language. Your conversation history is stored in the history directory.Offline execution is performed by appending "--offline" after this command.aibostartModelsWe support the following APIs for online/offline execution.modelonlineofflineChatGPT(gpt-3.5-turbo)⭕️❌Whisper⭕️⭕️ |
aibolit | DevTool recommending how to improve the maintenance quality of your Java classes |
aiboot | CubeAI模型服务化引擎 —— AI-Boot将AI模型推理程序封装成为Web互联网服务。目前提供RESTful API、WebSocket和可视化Web GUI等多种形式的互联网API接口服务,支持二进制数据传输和文件上传。依赖包地址https://pypi.org/project/aiboot依赖包引用$ pip install aiboot应用开发实例CubeAI智立方https://github.com/cube-ai/cubeaihttps://code.ihub.org.cn/projects/1484/repository/cubeai_model_examples |
aibo-server | aibo-serveris the backing Python server for theaibo.elEmacs package that leverages OpenAI's chat API to bring ChatGPT into EmacsInstallationThis package requires Python 3.11 or greaterpipinstallaibo-serverStart serverNormally the server will be run using theaibo.cli.startcommand in emacspython-maibo.cli.startbut it's also possible to run it usinguvicornuvicornaibo.server.main:app--port5000DatabaseThe server uses a simple sqlite database, by default stored in~/.aibo/database.dbCustomizationFor Python environment customizations, refer toconstants.py. |
ai-bot | ai_bot0.1.0 |
aibotaditya | AI Package with neural network |
aibou | AibouQuickstartpipinstallaibou
python-maibouLinux# keyboard module requires rootsudosu
pipinstallaibou
python-maibouInfoAuthored byJacob KrolDeveloper timelineCore game development: Winter break of 2022-2023Develop and publish python package: Winter break of 2023-2024 |
aibox | ai code library for rucaibox group |
aibox-core | readme |
aiboxlab | No description available on PyPI. |
aibox-ops | readme |
aibridge-test | AIBridge 0.0.1AIBridge is the python package with the support of the Multiple LLM's,User can utilised the Formatters ,prompts, varibales to get most of the LLM's Through the AIBridgeRequirementPython 3Install The Test packagepipinstallaibridge-testSet aibridge_config.yamlSetting the the aibridge_config.yaml at your desire choiceIn .env file set the path for file.Exampleinbashweset:exportAIBRIDGE_CONFIG=C:/Users/Admin/aibridge/aibridge_config.yamlvariablenameforenv:AIBRIDGE_CONFIGstarterfile.&id001data:*id001group_name:my_consumer_groupmessage_queue:redisno_of_threads:1open_ai:-key:APIKEYHEREpriority:equalpalm_api:-key:APIKEYHEREpriority:equalstable_diffusion:-key:APIKEYHEREpriority:equalredis_host:localhostredis_port:LoacalHoststream_name:my_streamdatabase:nosqldatabase_name:aibridgedatabase_uri:mongodb://localhost:27017per_page:10ConfigurationWith the help of the AIBridge we can svae the prompts in your sql/nosql data bases by default the :sqllite on the disc spaceTo configure the database you have add the data in config file.fromAIBridgeimpprtSetconfig#call the config methodSetconfig.set_db_confonfig(database=sql,database_name=None,database_uri=None)#parameters:#database-sql/nosql#database_uri: url of the databse of your choice(all sql support for no sql(Mongo))If you want use the sqllite on the disc no need to configure these for db supportCurrently AI bridge support only the OPEN_AI api:fromAIBridgeimportSetConfigSetConfig.set_api_key(ai_service="open_ai",key="YOUR_API_KEY",priority="high")#priority:high/medium/low/equalPrompt savePrompt save mechanism is used the save the reusable and extraordinary prompts that give you the exceptional result from LLMfromAIBridgeimportPromptInsertion# save promptdata=PromptInsertion.save_prompt(prompt="your prompt:{{data}},context:{{context}}",name="first_prompt",prompt_data={"data":"what is purpose of the ozone here"},variables={"context":"environment_context"},)print(data)# parameters: prompt_data: is used to manipulatre the same prompt with diffrent context at realtime# variables: is used to manipulate the prompt with fixed context as varibales is a specific data#update prompt can see the prompt_data and variables, is used the get diffrent output from same promptdata=PromptInsertion.update_prompt(id="prompt_id",name="updated_prompt",prompt_data={"data":"write abouts the plastic pollution"},variables={"context":"ocean_pollution"},)print(data)#Get prompt from iddata=PromptInsertion.get_prompt(id="prompt_id")print(data)# pagination support for getting the all promptdata=PromptInsertion.get_all_prompt(page=1)print(data)variableswhy variables?-> variables are the specific data used the get the desired and with context from ai LLM's.These is the example of the self consistance prompts Ref:https://www.promptingguide.ai/techniques/consistencyVaribales methods:fromAIBridgeimportVariableInsertion# save varibales# parameters: var_key: key for the varibales# var_value: list of the string for the contextdata=VariableInsertion.save_variables(var_key="ochean_context",var_value=["Ocean pollution is a significant environmental issue that poses a threat to marine life and ecosystems"],)print(data)# update the variablesdata=VariableInsertion.update_variables(id="variable_id",var_key="updated_string",var_value=["updated senetece about topics"],)print(data)# get Variables from iddata=VariableInsertion.get_variable(id="variable_id")# get all Variables paginationdata=VariableInsertion.get_all_variable(page=1)Get ResponseLLm=open_aidefault_model="gpt-3.4-turbo-oo3"Max_toke count - 3500temprature set to 0.5
methodsfromAIBridgeimportOpenAIServiceimportjsonjson_schema=json.dumps({"animal":["list of animals"]})xml_schema="<animals><category>animal name</category></animals>"csv="name,category,species,age,weight,color,habitat"data=OpenAIService.generate(prompts=["name of the animals in the {{jungle}}"],prompt_ids=None,prompt_data=[{"jungle":"jungle"}],variables=None,output_format=["json"],format_strcture=[json_schema],model="gpt-3.5-turbo",variation_count=1,max_tokens=3500,temperature=0.5,message_queue=False,)print(data)# Prameters# prompts= list of the string that need to executed in session where output id dependant on each other,# promts_ids= prompt id's list and so at a time ids will execute or prompts,# prompt_data=[data of the every prompt id they required],# variables=[ varibale dict of the prompt],# output_format=["xml/json/csv/sql/"],# format_strcture=[out put strcture of the prompt],# model="gpt-3.5-turbo", model for completion api of the gpt# variation_count = 1, n of the output require# max_tokens = 3500, maximut token per out put# temperature = 0.5, data consistecy# message_queue=False, scalability purposeoutput={"items":{"response":[{"data":['{"animal": ["lion", "tiger", "elephant", "monkey", "snake", "gorilla", "leopard", "crocodile", "jaguar", "giraffe"]}']}],"token_used":85,"created_at":1689323114.9568439,"ai_service":"open_ai",}}Message Queuedefault Queue=redis,Configure redisfromAIBridgeimportSetConfig# set redis configurationSetConfig.redis_config(redis_host="localhost",redis_port="port _for redis",group_name="consumer gorup name",stream_name="redis topic",no_of_threads=1,#concurrent thread ypu want run for your application)To use the Queue service set message_queue = TruefromAIBridgeimportOpenAIServiceimportjsonjson_schema=json.dumps({"animal":["list of animals"]})data=OpenAIService.generate(prompts=["name of the animals in the {{jungle}}"],prompt_ids=None,prompt_data=[{"jungle":"jungle"}],variables=None,output_format=["json"],format_strcture=[json_schema],message_queue=True# to activate message queue service)# to use the Queue service use the name set the message queue prameter = Trueprint(data)*Response for above function is the id of the response stored in the databse{"response_id":"eaa61944-3216-4ba1-bec5-05842fb86d86"}Message queue is for increasing scalibiltyfor APplication server you have turn on the consumer when application getting started.fromAIBridgeimportMessageQ# to start the consumer in backgroundMessageQ.mq_deque()In the non application environmen:you can run set message queue=TrueRun the below function to procees the Stream data in consumerfromAIBridgeimportMessageQ# these for testingthe redis env in local on single page filedata=MessageQ.local_process()print(data)###Dalle image genration###fromAIBridge.ai_services.openai_imagesimportOpenAIImageimages=OpenAIImage.generate(prompts=["A sunlit indoor lounge area with a pool containing a flamingo"],image_data=["image loacation or image url"],mask_image=["image loacation or image url"],variation_count=1,process_type="edit",)print(images)# prompts: is list string how many diffrent image we have to genearte# image_data: is the lacation of the image in file or the image url# mask_image: is the mask image with transpernet patch in the image where we want edit the images# variation_count: is the number of image we want to generate# prcess type : create, edit, variation,# create is for genrating new images# edit the image with the mask mask is compulsary to edi the images# variation is for genrating new images of sama typePalm-Text APi IntegrationTo set APi key in aibridge_config.yaml file you can add the it directly in aibridge_config.yaml file in the formatpalm_api:-key:AIz****************************QkkA(your-api_key)priority:equalfromAIBridgeimportSetConfigSetConfig.set_api_key(ai_service="palm_api",key="YOUR_API_KEY",priority="high")#priority:high/medium/low/equal```python
from AIBridge import PalmText
prompt = """
write paragraph about the {{prompting}}in ai and let user know what is the{{prompting}} and how the {{prompting}} works in genrative AI
"""
json_format = """{"text": "paragraph here"}"""
data = PalmText.generate(
prompts=[prompt],
prompt_data=[{"prompting": "model training"}],
output_format=["json"],
format_strcture=[json_format],
message_queue=True,
)
print(data)
# Prameters
# prompts= list of the string that need to executed in session where output id dependant on each other,
# promts_ids= prompt id's list and so at a time ids will execute or prompts,
# prompt_data=[data of the every prompt id they required],
# variables=[ varibale dict of the prompt],
# output_format=["xml/json/csv/sql/"],
# format_strcture=[out put strcture of the prompt],
# model="models/text-bison-001", model for generate api of the palm
# variation_count = 1-8, n of the output require
# max_tokens = default 10000, maximut token per out put, no limit for token"
# temperature = default-0.5, data consistecy
# message_queue=False, scalability purposePalm CHAT- APIfromAIBridgeimportPalmChat# An array of "ideal" interactions between the user and the modelexamples=[("What's up?","What isn't up?? The sun rose another day, the world is bright, anything is possible!",),("I'm kind of bored","How can you be bored when there are so many fun, exciting, beautiful experiences to be had in the world?",),]data=PalmChat.generate(messages="give the protype for the stack on c++",context="carreer or growth advides",variation_count=3,message_queue=True,)print(data)# mesages: text provided to chat# context: on the what basis do you want start the chat# examples: demo for the LLm to undersat the tone and what do you reaaly want(few shot prompt type)# variation_count: how many variations of the context should be used# message_queue: if true, the chat will return the messages in a queue# temperature = default-0.5, data consistecyStableDiffusion Imagestable_diffusion:-key:API Key herepriority:equalstable diffusion we have 3 action "img2img,text2image, inpaint"default parameter required for the api are:ParameterDescriptionkeyYour API Key used for request authorization.negative_promptItems you don't want in the image.widthMax Height: Width: 1024x1024. Should be divisible by 8.heightMax Height: Width: 1024x1024. Should be divisible by 8.samplesNumber of images to be returned in response. The maximum value is 4.num_inference_stepsNumber of denoising steps. Available values: 21, 31, 41, 51.safety_checkerA checker for NSFW images. If such an image is detected, it will be replaced by a blank image.enhance_promptEnhance prompts for better results; default: yes, options: yes/no.seedSeed is used to reproduce results, same seed will give you the same image in return again. Pass null for a random number.guidance_scaleScale for classifier-free guidance (minimum: 1; maximum: 20).multi_lingualAllow multilingual prompt to generate images. Use "no" for the default English.panoramaSet this parameter to "yes" to generate a panorama image.self_attentionIf you want a high-quality image, set this parameter to "yes". In this case, the image generation will take more time.upscaleSet this parameter to "yes" if you want to upscale the given image resolution two times (2x). If the requested resolution is 512 x 512 px, the generated image will be 1024 x 1024 px.embeddings_modelThis is used to pass an embeddings model (embeddings_model_id).webhookSet a URL to get a POST API call once the image generation is complete.track_idThis ID is returned in the response to the webhook API call. This will be used to identify the webhook request.text2imagfromAIBridgeimportStableDiffusiondata=StableDiffusion.generate(prompts=["cat sitting on bench"],# prompts is the list for how many images you have to genrate per requestaction="text2img",)print(data)Response{'0': {'status': 'success', 'generationTime': 0.7476449012756348, 'id': 40967676, 'output': ['https://cdn2.stablediffusionapi.com/generations/a77b1e09-e7ee-480b-80ad-abbdcdb66877-0.png'], 'meta': {'H': 512, 'W': 512, 'enable_attention_slicing': 'true', 'file_prefix': 'a77b1e09-e7ee-480b-80ad-abbdcdb66877', 'guidance_scale': 7.5, 'model': 'runwayml/stable-diffusion-v1-5', 'n_samples': 1, 'negative_prompt': 'low quality', 'outdir': 'out', 'prompt': 'cat sitting on bench', 'revision': 'fp16', 'safetychecker': 'yes', 'seed': 2873893487, 'steps': 20, 'vae': 'stabilityai/sd-vae-ft-mse'}}}img2imgfromAIBridgeimportStableDiffusioninit_image="https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"data=StableDiffusion.generate(prompts=["cat sitting on bench"],image_data=[init_image],#image data is the list followed by the prompts for each prompt there should be one image dataaction="img2img",)print(data)Response{"0":{"status":"success","generationTime":0.7667558193206787,"id":40968310,"output":["https://cdn2.stablediffusionapi.com/generations/2f1a2b63-8569-4b94-9b86-41d142f72774-0.png"],"meta":{"H":512,"W":512,"file_prefix":"2f1a2b63-8569-4b94-9b86-41d142f72774","guidance_scale":7.5,"init_image":"https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png","n_samples":1,"negative_prompt":"","outdir":"out","prompt":"cat sitting on bench","safetychecker":"yes","seed":1762284371,"steps":20,"strength":0.7}}}inpaintfromAIBridgeimportStableDiffusionmask_image="https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png"init_image="https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png"data=StableDiffusion.generate(prompts=["cat sitting on bench"],image_data=[init_image],mask_image=[mask_image],action="inpaint",)print(data)Response{"0":{"status":"success","generationTime":0.8590030670166016,"id":40967907,"output":["https://cdn2.stablediffusionapi.com/generations/59f14b2a-9ef5-4e41-83fc-fb1e5ff9b791-0.png"],"meta":{"H":512,"W":512,"file_prefix":"59f14b2a-9ef5-4e41-83fc-fb1e5ff9b791","guidance_scale":7.5,"init_image":"https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo.png","mask_image":"https://raw.githubusercontent.com/CompVis/stable-diffusion/main/data/inpainting_examples/overture-creations-5sI6fQgYIuo_mask.png","n_samples":1,"negative_prompt":"","outdir":"out","prompt":"cat sitting on bench","safetychecker":"yes","seed":242418520,"steps":20,"strength":0.7}}}NoteAt the image genration time thorugh api in stable diffusion complexex image some time take time so they are keep in the que and to fetch the image after completion we have to provide the response idfromAIBridgeimportStableDiffusiondata=StableDiffusion.fetch_image(id="image_id here")print(Data){
"status": "success",
"id": 12202888,
"output": [
"https://pub-8b49af329fae499aa563997f5d4068a4.r2.dev/generations/e5cd86d3-7305-47fc-82c1-7d1a3b130fa4-0.png"
]
}for Getting the information about all Queuing parametersfrom AIBridge import StableDiffusion
data=StableDiffusion.system_load(id="image_id here")
print(Data){"queue_num":0,"queue_time":0,"status":"ok"}Cohere APi'scohere_api:-key:API Key herepriority:equalfromAIBridgeimportSetConfigSetConfig.set_api_key(ai_service="cohere_api",key="YOUR_API_KEY",priority="high")#priority:high/medium/low/equalfromAIBridgeimportCohereApijson_str="""{"text": "text here"}"""csv_string="name,animal_type,prey,predators"xml_string="""<data><animal>animal information here</animal></data>"""data=CohereApi.generate(prompts=["give the me the more information about the {{animals}}"],prompt_data=[{"animals":"animals"}],format_strcture=[xml_string],output_format=["xml"],)print(data)# Prameters# prompts= list of the string that need to executed in session where output id dependant on each other,# promts_ids= prompt id's list and so at a time ids will execute or prompts,# prompt_data=[data of the every prompt id they required],# variables=[ varibale dict of the prompt],# output_format=["xml/json/csv/sql/"],# format_strcture=[out put strcture of the prompt],# model="models/text-bison-001", model for generate api of the palm# variation_count = the output require# max_tokens = default 10000, maximut token per out put, no limit for token"# temperature = default-0.5, data consistecy# message_queue=False, scalability purposeAI21 Api'sai21_api:-key:API Key herepriority:equalfromAIBridgeimportSetConfigSetConfig.set_api_key(ai_service="ai21_api",key="YOUR_API_KEY",priority="high")#priority:high/medium/low/equalfromAIBridgeimportJurasicTextjson_str="""{"text": "text here"}"""csv_string="name,animal_type,prey,predators"xml_string="""<?xml version="1.0" encoding="UTF-8" ?><data><animal>animal information here</animal></data>"""data=JurasicText.generate(prompts=["give the me the more information about the {{animals}}"],prompt_data=[{"animals":"tigers"}],format_strcture=[csv_string],output_format=["csv"],)print(data)# Prameters# prompts= list of the string that need to executed in session where output id dependant on each other,# promts_ids= prompt id's list and so at a time ids will execute or prompts,# prompt_data=[data of the every prompt id they required],# variables=[ varibale dict of the prompt],# output_format=["xml/json/csv/sql/"],# format_strcture=[out put strcture of the prompt],# model="models/text-bison-001", model for generate api of the palm# variation_count = the output require# max_tokens = default 10000, maximut token per out put, no limit for token"# temperature = default-0.5, data consistecy# message_queue=False, scalability purpose |
aibrilpodo | No description available on PyPI. |
aibro | AIbroAIbro is a serverless model training tool that helps data scientists train AI models on cloud platforms with one line of code.Documentation:https://doc.aipaca.ai/,Company Website:https://aipaca.ai/Potential Install Error:IfOSError: protocol not foundshows up, it is caused by missing/etc/protocols file.file. This command should be able to resolve the error:sudo apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall netbase |
aib-test | Failed to fetch description. HTTP Status Code: 404 |
aibuilder | Project descriptionAI Builder SDKAI Builder is a Microsoft Power Platform capability that provides AI models that are designed to optimize your business
processes. AI Builder enables your business to use AI to automate processes and glean insights from your data
inPower AppsandPower Automate.This SDK allows registration of model endpoints as AI Models with power platform to be leveraged in flows and power
apps.InstallingInstall Python 3.6+ from the linkhere. Click the 'Download' link on any version of Python greater than Python 3.6. For Linux and Mac OS please follow the appropriate link on the page. You can also install using an OS specific package manager of your choice.Run the installer to begin installation and be sure to check the box 'Add Python X.X to PATH'.Make sure the installation path is in the PATH variable by running:python --versionAfter python is installed, install aibuilder by running:pip install -f https://test.pypi.org/simple/ aibuilderCapabilitiesGet an EnvironmentAn environment is a space to store, manage, and share your organization's business data, apps, and flows. It also serves
as a container to separate apps that might have different roles, security requirements, or target audiences. How you
choose to use environments depends on your organization and the apps you're trying to build. Each environment is created
under an Azure Active Directory (Azure AD) tenant, and its resources can only be accessed by users within that tenant.
When you create an app in an environment, that app is only permitted to connect to the data sources that are also
deployed in that same environment, including connections, gateways, flows, and Dataverse databases. The AI Builder SDK
allows you to programmatically retrieve an existing environment where you want to register your machine learning model.
Clickhereto know more about
environments in Power Platform.Registering a modelOnce you have your machine learning model hosted on an endpoint, you can then create a scoring script to run the hosted
machine learning model. This script which now represents the machine learning model is required to be registered with
AI Builder in order to use prediction.Usage and ExamplesLet’s say you have a machine learning model deployed on an endpoint and you are able todeploythe model
successfully on an Azure Container Instance. Here is an example use case in AI Builderfromazureml.core.webserviceimportAciWebservice,Webservice,Workspacefromazureml.exceptionsimportWebserviceExceptionfromaibuilder.core.environmentimportEnvironmentfromaibuilder.models.constantsimportModelClientResponseStatus# The name of the Power Platform environment where you are registering the modelenvironment_name='environment_name'# The name of the model endpoint to be created in AzureMLaci_service_name='service_name'# The name of the model as it will appear in AI Buildermodel_name="name_of_model_to_be_registered"ws=Workspace.get(name='your_workspace_name',subscription_id='your_subscription_id',resource_group='your_resource_group')# Get the ACI service based on what you deployed (otherwise, create one if service is not found)try:service=Webservice(ws,name=aci_service_name)exceptWebserviceExceptionase:print(f"Service not found:{aci_service_name}")print(service.state)# Should be displayed as healthy# Get the Environmentenv=Environment.get(environment_name=environment_name)# Register your machine learning model to AI Builderresponse=env.register_model(model_name=model_name,connection=service)ifresponse!=ModelClientResponseStatus.success:raiseException('Model registration failed')print(f"Registered AI Builder model{model_name}")LicenseAI Builder SDK
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
aibuildersart | แพ็คเกจนี้ใช้สำหรับโชว์รูปศิลปะ ascii ซึ่งได้ผลงานมาจากสมาชิกเพจ
AIBuilders ช่วยกันเขียนขึ้นมาวิธีติดตั้งเปิด CMD / Terminalpipinstallaibuildersartวิธีใช้งานfromaibuildersartimport*show=UncleEngineer()show.art()print("Author:{}".format(show.name)) |
ai-bundle | api_bundleA bundle to serve ai models. |
aic | No description available on PyPI. |
aica-api | Python AICA API ClientThe AICA API client module provides simple functions for interacting with the AICA API.pipinstallaica-apiThe client can be used to easily make API calls as shown below:fromaica_api.clientimportAICAaica=AICA()aica.set_application('my_application.yaml')aica.start_application()aica.load_component('my_component')aica.unload_component('my_component')aica.stop_application()To check the status of component predicates and conditions, the following blocking methods can be employed:fromaica_api.clientimportAICAaica=AICA()ifaica.wait_for_condition('timer_1_active',timeout=10.0):print('Condition is true!')else:print('Timed out before condition was true')ifaica.wait_for_predicate('timer_1','is_timed_out',timeout=10.0):print('Predicate is true!')else:print('Timed out before predicate was true')Compatability tableThe latest version of the AICA API client will generally support the latest API version in the AICA framework. For
older versions of the AICA framework, it may be necessary to install older versions of the client. Use the following
compatability table to determine which client version to use.API server versionMatching Python client versionv3.x>= v2.0.0v2.xv1.2.0<= v1.xUnsupportedRecent client versions also support the following functions to check the client version and API compatability.fromaica_api.clientimportAICAaica=AICA()# get the current client versionaica.client_version()# check compatability between the client version and API versionaica.check() |
aicademeCV | No description available on PyPI. |
aicafe | AICafeThis is a Python package for intracranial vascular image analysis.
See more in the documentation.This package is currently not ready to be used. Current version is only used as a placeholder. |
aicaliber | UseOneSpaceinstead. |
aicampxyz | No description available on PyPI. |
aicapi2021-yw3760 | AICAPI2021_YW3760This is a python package of an API CLIENT to retrieve the data of collections in the Atr Institute of Chicago. The outputs inlude: An table include related information about the searched artworks. An table include related information about the searched tours. An image of an artwork, searched by title and artist. An table include related information about the searched products.Installation$pipinstallAICAPI2021_YW3760UsageTODOContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.LicenseAICAPI2021_YW3760was created by YW3760. It is licensed under the terms of the MIT license.CreditsAICAPI2021_YW3760was created withcookiecutterand thepy-pkgs-cookiecuttertemplate. |
aicapi-yw3760 | aicapi_yw3760This is a python package of an API CLIENT to retrieve the data of collections in the Atr Institute of Chicago.
The outputs inlude:
An table include related information about the searched artworks.
An table include related information about the searched tours.
An image of an artwork, searched by title and artist.
An table include related information about the searched products.Installation$pipinstallaicapi_yw3760UsageTODOContributingInterested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.Licenseaicapi_yw3760was created by yw3760. It is licensed under the terms of the MIT license.Creditsaicapi_yw3760was created withcookiecutterand thepy-pkgs-cookiecuttertemplate. |
aicaptcha | AiCaptchaPython library for solving various types of captcha including Hcaptcha, ReCaptchaV3(enterprise/normal), ObjectRecognition and Audio.InstallationTo install the library, simply run the following command:pip install aicaptchaUsageTo use the library, import the AiCaptcha class from the aicaptcha module, create an instance of the class with your API key, and call the appropriate method to solve the captcha.Here's an example:fromaicaptchaimportAiCaptchaapi_key="your_api_key_here"solver=AiCaptcha(api_key)# Solve an Hcaptchahcaptcha_result=solver.Hcaptcha(site_key="hcaptcha_site_key_here",page_url="hcaptcha_page_url_here",user_agent="your_user_agent_here")print(hcaptcha_result.token)print(hcaptcha_result.key)# Solve a ReCaptchaV3 (enterprise/normal)recaptchav3_result=solver.ReCaptchaV3(type="recaptchav3_type(enterprise/normal)",site_key="recaptchav3_site_key_here",page_url="recaptchav3_page_url_here",action="recaptchav3_action_here")print(recaptchav3_result.token)# Solve a audio captchaaudio_captcha_result=solver.Audio(audio="audio_filename_or_content_or_url",numbers_sensitivity=False)print(audio_captcha_result.text)print(audio_captcha_result.confidence)# Solve the captcha specifying the name of the objectsobject_recognition_captcha_result=solver.ObjectRecognition(image="image_filename_or_content_or_url",max_results=5)print(object_recognition_captcha_result.results)ChannelTelegram :AiCaptchaSupportTelegram :supportfor free trial contact support. |
ai-care | AI-CareCurrent AI models are only capable of passively responding to user inquiries
and lack the ability to initiate conversations.
AI-Care endows AI with the capability to speak proactively.
With simple settings, AI-Care allows your AI to proactively care for you.Highlights✨💵Low Cost: In terms of both token usage and API call frequencies, AI-Care is designed to minimize these expenses.
It operates with an O(1) cost complexity, which means that the costs do not increase with the duration of its activation.🕊️Low Intrusiveness: AI-Care provides its services alongside existing systems,
with virtually zero intrusion into the original code.
This allows for easy integration of AI-Care services into existing systems.🌍Model Universality: Compatible with all LLM (Large Language Model) models,
AI-Care does not rely on function call features or specific ways in which the model is used.UsageDefine the "to_llm" and "to_user" interfaces. AICare uses the "to_llm" interface to send
messages to the LLM and uses the "to_user" interface to send messages to the user.defto_llm_method(chat_context,to_llm_messages:list[AICareContext])->str|Generator[str,None,None]:# Here you need to convert `to_llm_messages` into the message format of the LLM you are using# and send the message to the LLM.# The return value is the message content replied by the LLM.# If you are not using stream mode, directly return the reply message string.# You can also use stream mode, in which case a string generator should be returned.# If using stream mode, AICare will also automatically use stream mode when sending messages to the user.passdefto_user_method(to_user_message:str|Generator[str,None,None])->None:# Here you need to process messages from AICare as you would a normal LLM reply.# If using stream mode, this method should be able to receive and handle a string generator.# If the `to_llm` method uses stream mode, then this method should also use stream mode.passInstantiate AICare:fromai_careimportAICareai_care=AICare()Register "to_llm" and "to_user" methods:ai_care.register_to_llm_method(to_llm_method)ai_care.register_to_user_method(to_user_method)Using AICare# After each round of conversation or when AICare service is neededai_care.chat_update(chat_context)AI-Care settings# Set guidance informationai_care.set_guide(guide="your guide")# Set how long before AI-Care is activatedai_care.set_config(key="delay",value=60)# Set the number of times AI-Care selects “ASK_LATER”, setting it to 0 can disable this option.ai_care.set_config(key="ask_later_count_limit",value=1)# Set the system default recursive depth for ask.ai_care.set_config(key="ask_depth",value=1)# Set the maximum number of chat intervals the system automatically records.ai_care.set_config(key="n_chat_intervals",value=20)LicenseThis project is licensed under theMIT License. |
aicc-tools | aicc介绍aicc是一款面向MindSpore开发者和华为计算中心,致力于易化和规范化云上文件交互过程,简化云上日志显示,以此加速模型开发进度和降低云上集群调试难度。其包含三大功能:云上日志显示分类;云上文件交互传输; 云上分布式训练启动。aicc不仅能够帮助开发者便捷、快速的将本地(线下)代码迁移至计算中心,还可以一行代码解决云上分布式训练问题。利用云上文件交互传输功能,可解决云上大规模模型或大规模数据实时交互传输问题。简洁的日志显示和分类系统也极大地便利了开发者利用云上集群调试大模型。特性CFTS:文件交互传输系统AiLog:云上日志显示系统Distribute Training:云上分布式训练安装教程pipinstallaicc_tools使用说明云上环境初始化importaicc_toolsasac# moxing 交互环境注册(可选)避免文件交互过程中动态密钥失效而中断ac.mox_register(ak='#@#$',sk='*&^%',server='https://obs.cn-central-221.ovaijisuan.com')# 一行代码开启云上分布式训练"""Args:seed: 设置随机种子数use_parallel: 是否使用分布式训练,默认是True基本环境初始化配置。支持mindspore.context.set_context(**kwargs)内所有支持的参数配置context_config = {"mode": "GRAPH_MODE", "device_target": "Ascend", "device_id": 0}并行环境初始化配置。支持mindspore.context.set_auto_parallel_context(**kwargs)内所有支持的参数配置parallel_config = {"parallel_mode": "DATA_PARALLEL", "gradients_mean": True}Return:rank_id: 当前程序执行的device编号device_num: 使用的总的device数量"""local_rank,device_num=ac.cloud_context_init(seed=args.seed,use_parallel=use_parallel,context_config=context,parallel_config=parallel)云上文件交互系统# Step1 init cfts'''obs_path: 用于存储云上训练过程中产生的所有数据的obs桶路径, 通常是以obs或s3开头的链接rank_id: 当前程序执行的device编号, 默认按照一个节点只回传一张卡的数据upload_frequence:回传数据至obs桶的频次,默认是训练一个step回传一次数据keep_last:保持始终是最新的文件,删掉旧文件,默认是True'''cfts=ac.CFTS(obs_path="obs存储路径",rank_id=0,upload_frequence=1,keep_last=True)# 获取obs的数据集(可选)'''默认返回云上训练作业容器内实际的数据集存放路径,方便开发者一键移植到数据集读取和处理代码中'''ds_path=cfts.get_dataset(dataset_obs="obs数据集路径")# 获取obs的checkpoint模型参数文件(可选)'''默认返回云上训练作业容器内实际的模型文件存储路径,方便开发者进行后续加载和处理'''ckpt_path=cfts.get_checkpoint(checkpoint_obs="obs模型路径")# Step2 获取内置 callback, 注意所有需要保存文件的路径在云上已被默认,用户无需配置!## 保存checkpoint的callback函数(可选)'''function: cfts.checkpoint_monitor()集成了mindspore的ModelCheckpoint, CheckpointConfig,支持其所有超参'''ckpt_cb=cfts.checkpoint_monitor(prefix="mae")## 保存summary的callback函数(可选)'''function: cfts.summary_monitor()集成了mindspore的SummaryCollector所有支持功能'''summary_cb=cfts.summary_monitor(collect_freq=1)## 显示loss的callback函数(可选)'''function: cfts.loss_monitor()集成了mindspore的LossMonitor所有功能,改善日志打印体验'''loss_cb=cfts.loss_monitor(per_print_times=1)## 如果有自定义的callback函数,可直接加入到callback列表中,但需注意obs_monitor需放在列表最后一项custom_cb=CustomMonitor()# 不涉及文件保存custom_cb=CustomMonitor(save_dir=cfts.get_custom_path())# 涉及文件保存时,需传入cfts固定的用户路径,保证文件被回传!## 云上必须的文件回传callback函数!!!(必选)'''function: cfts.obs_monitor()规范云上文件与obs交互传输,云上必须使用该callback函数才能实现所有生成文件的回传!'''obs_cb=cfts.obs_monitor()## 用于model.train的callback定义callback=[loss_cb,summary_cb,ckpt_cb,custom_cb,obs_cb]云上日志显示系统# 日志系统,打印信息'''logger 可以自定义打印到 stdout 和文件的配置,可以实现不输出日志到 stdout、或者只有指定节点和设备才输出日志。可以控制输出到 stdout 和文件的日志的等级和格式,并可以控制单个日志文件的大小和最多保存多少个日志文件。'''logger=ac.get_logger(to_std=True,stdout_nodes=(0,1),stdout_devices=(0,1),stdout_level='ERROR',stdout_format=None,file_level='INFO',file_save_dir='./log/',file_prefix=None,max_file_size=50,max_num_of_files=5)logger.debug('debug message')logger.info('info message')logger.warning('warning message')logger.error('error message')logger.critical('critical message')使用样例参与贡献Fork 本仓库新建 Feat_xxx 分支提交代码新建 Pull Request |
ai.cdas | AI.CDAS: python interface toCDASdataThis library provides access to CDAS database from python in a simple and fluid way throughCDAS REST api. It fetches the data either inCDF (Common Data Format)or ASCII format and returns it in the form of dictionaries of numpy arrays.The full documentation is available ataicdas.rtfd.io.Getting startedDependenciesPython 3numpyrequestswgetExtra dependencies (at least one of the following)astropyCDF+spacepyInstallationStarting from version 1.2.0 AI.CDAS officially supports only Python 3, so make sure that you have a working isntallation of it.Assuming the above requirement is satisfied install the package with Python package manager:$ pip install ai.csKnown issuesNASA CDAS REST API endpoint currently does not support IPv6 addressing. However, newer linux distros (for example, Ubuntu 16.04) are set up to prefer IPv6 addressing over IPv4 by default. This may result in unneeded delays in communication with server and data polling. If you experience the issue it might be that is the case with your system. Here is how it can be cured on Ubuntu 16.04:$ sudoedit /etc/gai.conf
# Uncomment the line
# precedence ::ffff:0:0/96 100Now you machine will try IPv4 prior to IPv6. For other distros refer to respective docs.ExamplesExample 1: Retrieving observatory groups and associated instruments which measure plasma and solar wind:fromaiimportcdasimportjson# for pretty outputobsGroupsAndInstruments=cdas.get_observatory_groups_and_instruments('istp_public',instrumentType='Plasma and Solar Wind')print(json.dumps(obsGroupsAndInstruments,indent=4))Example 2: Getting STEREO-A datasets using regular expressions for dataset id and label:fromaiimportcdasimportjson# for pretty outputdatasets=cdas.get_datasets('istp_public',idPattern='STA.*',labelPattern='.*STEREO.*')print(json.dumps(datasets,indent=4))Example 3: Fetching a list of variables in one of STEREO datasets:fromaiimportcdasimportjson# for pretty outputvariables=cdas.get_variables('istp_public','STA_L1_MAGB_RTN')print(json.dumps(variables,indent=4))Example 4: This snippet of code gets magnetic field data from STEREO-A spacecraft for one hour of 01.01.2010 and plots it (requires matplotlib):fromaiimportcdasfromdatetimeimportdatetimefrommatplotlibimportpyplotaspltdata=cdas.get_data('sp_phys','STA_L1_MAG_RTN',datetime(2010,1,1),datetime(2010,1,1,0,59,59),['BFIELD'])plt.plot(data['EPOCH'],data['BTOTAL'])plt.show()Example 5: This snippet of code gets magnetic field data from STEREO-A spacecraft for one hour of 01.01.2010 and plots it (requires matplotlib). The data are downloaded in CDF format in this case. CDF format is binary and results in a much smaller filesize and hence faster downloads. In order for this to work you have to have NASA CDF library on your machine and spacepy installed afterwards:fromaiimportcdasfromdatetimeimportdatetimefrommatplotlibimportpyplotaspltdata=cdas.get_data('sp_phys','STA_L1_MAG_RTN',datetime(2010,1,1),datetime(2010,1,1,0,59,59),['BFIELD'],cdf=True# download data in CDF format)# Note that variables identifiers are different than in the previous# example. It often the case with CDAS data. You should check the# variables names by printing out `data` dictionary.plt.plot(data['Epoch'],data['BFIELD'][:,3])plt.show()Example 6: This snippet of code gets magnetic field data from STEREO-A spacecraft for 01.01.2010 and saves it to cache directory. The next time the same data is requested it is taken from cache without downloading:importosfromaiimportcdasfromdatetimeimportdatetime# For the sake of example we are using your current working# directory as a cache directorycache_dir=os.getcwd()cdas.set_cache(True,cache_dir)# this data is downloaded from CDASdata=cdas.get_data('sp_phys','STA_L1_MAG_RTN',datetime(2010,1,1),datetime(2010,1,1,0,59,59),['BFIELD'])# this data is taken from cachedata=cdas.get_data('sp_phys','STA_L1_MAG_RTN',datetime(2010,1,1),datetime(2010,1,1,0,59,59),['BFIELD']) |
aich | AICH-EncryptionEncryption Algorithm for All Languages. Generates a Token In Hindi.Installationsudo pip install aichUsagefrom a2 import aichsearch_word = input('Enter your encryption phrase:')encrypted = aich.aichin(search_word)print (encrypted)search_word = input('Enter your decryption phrase:')encrypted = aich.aichout(search_word)print (encrypted)Encryption Example{Inputs: This is freedom ये है आज़ादी , Outputs: षनफदपफदशफखकफयमफदशफखकफयमफददफखयफदषफदषफदनफदगफदतफयमफशयगफशनखफयमफशकशफशनपफयमफशमदफशणटफशकटफशकएफशयदफशनम}
{Inputs: AICH , Outputs: नणफनशफनकफनप}Decryption Example{Inputs: षनफदपफदशफखकफयमफदशफखकफयमफददफखयफदषफदषफदनफदगफदतफयमफशयगफशनखफयमफशकशफशनपफयमफशमदफशणटफशकटफशकएफशयदफशनम, Outputs: This is freedom ये है आज़ादी}
{Inputs: नणफनशफनकफनप , Outputs: AICH} |
ai-changelog | ai_changelogai_changelogis a Python project that automatically generates changelog files summarizing code changes, using AI.It usesLangChainandOpenAImodels to analyze Git commit diffs and generate natural language descriptions of the changes. This allows maintaining an up-to-date changelog without manual effort.This README was originally written by Claude, an LLM from Anthropic.Usageusage:ai_changelog[-h][--provider{openai,anthropic,anyscale}][--modelMODEL][--temperatureTEMPERATURE][--max_tokensMAX_TOKENS][--hub_promptHUB_PROMPT][--context_linesCONTEXT_LINES][--max_concurrencyMAX_CONCURRENCY][-v]refs
Processcommandlinearguments.
positionalarguments:refsReferencecomparisonwithstandardgitsyntax
options:-h,--helpshowthishelpmessageandexit--provider{openai,anthropic,anyscale}ModelAPIprovider--modelMODELModelname--temperatureTEMPERATUREModeltemperature--max_tokensMAX_TOKENSMaxtokensinoutput--hub_promptHUB_PROMPTPrompttopullfromLangChainHub--context_linesCONTEXT_LINESNumberofcontextlinesforeachcommit--max_concurrencyMAX_CONCURRENCYNumberofconcurrentconnectionstollmprovider(0meansnolimit)-v,--verboseRunLangChaininverbosemode
http://github.com/joshuasundance-swca/ai_changelogLocal installTo generate a changelog locally:pipinstallai_changelog
ai_changelog--help
ai_changelogmain..HEAD# to summarize changes locallyDockerdockerpulljoshuasundance/ai_changelog:latest
dockerrun\--env-file.env\-v/local_repo_dir:/container_dir_in_repo\-w/container_dir_in_repo\joshuasundance/ai_changelog:latest\main..HEADGitHub WorkflowTheai_changelog_main_pr.ymlworkflow runs on pushes tomain.It generates summaries for the new commits and appends them toAI_CHANGELOG.md. The updated file is then committed back to the PR branch.ai_changelogorigin/main^..origin/main# in a GitHub action to summarize changes in response to a push to mainai_changelogorigin/main..HEAD# in a GitHub action to summarize changes in response to a PRAnother flow was made to commit an updated changelog to an incoming PR before it was merged, but that seemed less useful although it did work well.ConfigurationSet environment variables as needed for your provider of choice (default requiresOPENAI_API_KEY).Set LangSmith environment variables to enable LangSmith integration, if applicable.Use command line arguments.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.TODOTestingGet CodeLlama working reliably in CICD (currently hit or miss on structured output) |
aichar | AicharPython library for creating/editing/transporting AI characters between different frontends (TavernAI,SillyTavern,TextGenerationWebUI,AI-companion, Pygmalion)This library allows you to read JSON, Yaml and character card files, edit their data, create your characters from scratch and export them as JSON, Yaml or character cards compatible with the frontends mentioned aboveInstallationpipinstallaicharUsageCreating a CharacterTo create a new character, you can use the create_character function. This function takes several parameters to initialize the character's attributes and returns a CharacterClass object.importaicharcharacter=aichar.create_character(name="Character Name",summary="Character Summary",personality="Character Personality",scenario="Character Scenario",greeting_message="Character Greeting Message",example_messages="Character Example Messages",image_path="Character Image Path")Loading a Character data from a PNG Character Card Filecharacter=aichar.load_character_card_file("character_card.png")Loading a Character data from a PNG Character Card Bytescharacter=aichar.load_character_card(data_bytes)Wheredata_bytescan be e.g. bytes of the opened png file of the character cardwithopen("character_card.png",'rb')asfile:data_bytes=file.read()Loading a Character data from a JSON Filecharacter=aichar.load_character_json_file("character.json")Loading a Character data from a JSON Stringcharacter=aichar.load_character_json('{"char_name": "Character Name", "char_persona": "Character Personality", "world_scenario": "Character Scenario", "char_greeting": "Character Greeting Message", "example_dialogue": "Character Example Messages", "name": "Character Name", "description": "Character Summary", "personality": "Character Personality", "scenario": "Character Scenario", "first_mes": "Character Greeting Message", "mes_example": "Character Example Messages"}')Loading a Character data from a Yaml Filecharacter=aichar.load_character_yaml_file("character.yaml")Loading a Character data from a Yaml Stringcharacter=aichar.load_character_yaml('char_name: Character Name\nchar_persona: Character Personality\nworld_scenario: Character Scenario\nchar_greeting: Character Greeting Message\nexample_dialogue: Character Example Messages\nname: Character Name\ndescription: Character Summary\npersonality: Character Personality\nscenario: Character Scenario\nfirst_mes: Character Greeting Message\nmes_example: Character Example Messages\nmetadata:\nversion: 1\ncreated: 1696945481977\nmodified: 1696945481977\nsource: null\ntool:\nname: aichar Python library\nversion: 0.5.0\nurl: https://github.com/Hukasx0/aichar\n')Modifying Character AttributesYou can modify the attributes of a character. Here are some examples:# Load a character card from a JSON filecharacter=aichar.load_character_json_file("character_data.json")# Change character namecharacter.name="New Name"# Change character summarycharacter.summary="New Summary"# Change character personalitycharacter.personality="New Personality"# Change character scenariocharacter.scenario="New Scenario"# Change character greeting messagecharacter.greeting_message="New Greeting Message"# Change character example messagescharacter.example_messages="New Example Messages"# Change character image path (needed if you want to export character as character png card)character.image_path="New Image Path"Printing Character Information SummaryYou can get character's information summary by using the data_summary attribute:print(character.data_summary)Accessing Character AttributesYou can access character's attributes using the provided getter methods. For example:print("Character Name: ",character.name)print("Character Summary: ",character.summary)print("Character Personality: ",character.personality)image_path=character.image_pathExporting Character DataYou can export the character's data in different formats using the export_card_file, export_json, export_json_file, export_yaml and export_yaml_file function. Supported export formats include "tavernai" (or "sillytavern"), "textgenerationwebui" (or "pygmalion"), and "aicompanion".exporting data as character card png:# Export character card in "tavernai" formatcharacter.export_card_file("tavernai","tavernai_character_card.png")# Export character card in "sillytavern" formatcharacter.export_card_file("sillytavern","sillytavern_character_card.png")# Export character card in "textgenerationwebui" formatcharacter.export_card_file("textgenerationwebui","textgenerationwebui_character_card.png")# Export character card in "pygmalion" formatcharacter.export_card_file("pygmalion","pygmalion_character_card.png")# Export character card in "aicompanion" formatcharacter.export_card_file("aicompanion","aicompanion_character_card.png")exporting data as json string or file:# Export character data in "tavernai" formattavernai_json_string=character.export_json("tavernai")# or to filecharacter.export_json_file("tavernai","tavernai_character_data.json")# Export character data in "sillytavern" formatsillytavern_json_string=character.export_json("sillytavern")# or to filecharacter.export_json_file("sillytavern","sillytavern_character_data.json")# Export character data in "textgenerationwebui" formattextgenerationwebui_json_string=character.export_json("textgenerationwebui")# or to filecharacter.export_json_file("textgenerationwebui","textgenerationwebui_character_data.json")# Export character data in "pygmalion" formatpygmalion_json_string=character.export_json("pygmalion")# or to filecharacter.export_json_file("pygmalion","pygmalion_character_data.json")# Export character data in "aicompanion" formataicompanion_json_string=character.export_json("aicompanion")# or to filecharacter.export_json_file("aicompanion","companion_character_data.json")exporting data as yaml string or file:# Export character data in "tavernai" formattavernai_yaml_string=character.export_yaml("tavernai")# or to filecharacter.export_yaml_file("tavernai","tavernai_character_data.yml")# Export character data in "sillytavern" formatsillytavern_yaml_string=character.export_yaml("sillytavern")# or to filecharacter.export_yaml_file("sillytavern","sillytavern_character_data.yml")# Export character data in "textgenerationwebui" formattextgenerationwebui_yaml_string=character.export_yaml("textgenerationwebui")# or to filecharacter.export_yaml_file("textgenerationwebui","textgenerationwebui_character_data.yml")# Export character data in "pygmalion" formatpygmalion_yaml_string=character.export_yaml("pygmalion")# or to filecharacter.export_yaml_file("pygmalion","pygmalion_character_data.yml")# Export character data in "aicompanion" formataicompanion_yaml_string=character.export_yaml("aicompanion")# or to filecharacter.export_yaml_file("aicompanion","companion_character_data.yml")Or you can export it in neutral format for those frontends:neutral_json_string=character.export_neutral_json()neutral_yaml_string=character.export_neutral_yaml()character.export_neutral_json_file("neutral_character_data.json")character.export_neutral_yaml_file("neutral_character_data.yml")character.export_neutral_card_file("neutral_card_name.png")Exporting character cards as bytescharacter_neutral_bytes_list=character.export_neutral_card()# you can also export in any format you choosecharacter_sillytavern_bytes_list=character.export_card("sillytavern")Why bytes_list and not just bytes?Both .export_neutral_card() and .export_card() methods return 'bytes': 'list', if you need bytes then you can use the python function bytes() to convert the data to 'PyBytes'.
For example, you will get an error like this:TypeError: argument 'bytes': 'list' object cannot be converted to 'PyBytes'Example of a solution to a problem:character_neutral_bytes=bytes(character.export_neutral_card())# then you can perform the same operations on it as you would on bytesnew_character=aichar.load_character_card(character_neutral_bytes)License2023-2024 Hubert KasperekAt any time when using the library, you can read the content of the license by calling the.license()methodprint(aichar.license())This library is distributed under theMIT License. |
aichat | .. image:: https://travis-ci.org/aira/aichat.svg?branch=master:target: https://travis-ci.org/aira/aichat======aichat======A chatbot framework for configuring and testing chatbot dialog specifications.Description===========`aichat` combines 2 approaches (more to come):1. pattern matching (grammar-based appraoch)2. search (retrieval-based approach)Like AIML `aichat` allows you to control context and build a graph of behaviors (edges are chatbot actions/utterances).You can hand-craft your behaviors or "machine learn" them from example dialog corpora.In the future `aichat` will incorporate a knowledge base (a grounding chatbot approach)Usage===========``` shell$ hey Bot, "What's up?"I heard you, but I'm not sure what you mean.``` |
aichatbot | AI-Chatbot 🤖Python library for building custom AI Chatbot with just one line of code.Get StartedInstall the packagepip install aichatbotLoad the moduleimportaichatbotasbotCreate theintents fileby following format{"intents":[{"tag":"tag name","patterns":["example-1 of user query","example-2 of user query","example-3"],"responses":["bot response-1","bot response-2","bot response-3"]}]}Thepatternscontains a list of exampleexpected user query, which user will enter andresponsescontains the list ofbot response.Whenever a user inputs a query, bot will find the closest match with thepatterns, and then select a random response from the list ofresponsesspecified under that pattern name.Example{"intents":[{"tag":"greeting","patterns":["Hi","How are you","Is anyone there?","Hello","Good day"],"responses":["Hello, thanks for visiting","Good to see you again","Hi there, how can I help?"]},{"tag":"goodbye","patterns":["Bye","See you later","Goodbye"],"responses":["See you later, thanks for visiting","Have a nice day","Bye! Come back again soon."]}]}Create the modelfilenames={"intents":"./data/basic_intents.json","dir":"dumps"}bot_model=bot.Create(filenames,technique="bow")intents: Path to your intents file.dir: Specify the directory where you want to save the bot model.technique: Choose among [ bow | lstm | bert ]That's it 😊,Start your conversationbot.start(bot_model)Optional Parameter:end_conversation: Contains strings to stop the chatbot.end_response: Output Message when bot quitsExample:bot.start(bot_model,end_conversation=["/stop","quit"],end_response="Thankyou for your time :)") |
ai-chat-chain | simple chat context manageroverride everythingworks with any modelworks with any prompt recovery system (simple history, embedding search, whatever)chains functions welluses ai-functions and executes theminstallpoetry add or pip install this repo, for nowexample:fromai_chatimportAiConfig# only supports openai for now, todo: add other modelsfromai_chat.openaiimportOpenaiChatfromai_chat.storeimportSupabaseStorefromai_functionsimportAIFunctions# supports SqliteStore() as well as MemoryStore() for storing the chain of promptsstore=SupabaseStore()conf=AiConfig(id="persona-id-1",system="You are a silly friend.")session=OpenaiChat(store=store,ai=conf,thread_id="session-1")defsearch_google():...defget_calendar():...defadd_calendar():...session.functions=AIFunctions([search_google,get_calendar,add_calendar])print(session.chat("hello").content)# this contains the hello, and the reply in the contextprint(session.chat("cool").content) |
aichat-cli | Ai Chat CLIA command-line interface chatbot. It allows you to have interactive conversations with different bots, including GPT4 FOR FREECheck the web versionhere(WIP).Thanks to@Lomusirefor providing premium tokens ❤️.We are in a race with poe.com devs baning our tokens, you can help bygenerating tokens.Updated poe.com token listhere.Features✨Choose between different bots.Input messages for the chatbot via command-line arguments or interactively.Export the conversation to a .txt file for future reference.Insert your clipboard for multiple-line messages.Delete your messages to respect your privacy.Updated tokens each dayPrerequisites📋Python 3.7 or higher installed on your system.Getting Started🚀Clone or download the CLI app repository to your local machine.Open a command-line interface (e.g., Command Prompt, Terminal) and navigate to the directory where you have saved the GPT CLI files.Install the required dependencies by running the following command:pip install -r requirements.txtRun the CLI app:cd aichat
python chatcli.pyOR download it using pip📥📦pip install aichat-cli --upgrade📦#####How to add pip package to PATH#####📦Open the command prompt.Typepip show aichat-cliand press Enter. This will show you the location of the package.Copy the path of the package.Open the Start menu and search for “Environment Variables”.Click on “Edit the system environment variables”.Click on “Environment Variables” button.Under “System Variables”, scroll down and find “Path” and click on “Edit”.Click on “New” and paste the path of the package that you copied earlier.Click on “OK” to save changes.🔐#####How To generate tokens manually#####🔐poe tokenLog intoPoeon any web browser, then open your browser's developer tools (also known as "inspect") and look for the value of thep-bcookie in the following menus:Chromium: Devtools > Application > Cookies > poe.comFirefox: Devtools > Storage > CookiesSafari: Devtools > Storage > Cookiesthen save the token by creatingpoe_token.txtin/aichat/tokensBard tokenLog intoBardon any web browser, then open your browser's developer tools (also known as "inspect") and look for the value of the__Secure-1PSIDcookie in the following menus:
(tip : copy the cookie name to the filter box)Chromium: Devtools > Application > Cookies > bard.google.comFirefox: Devtools > Storage > CookiesSafari: Devtools > Storage > Cookiesthen save the token by creatingbard_token.txtin/aichat/tokens:warning:Warning:Be careful using Bard tokens; they are Google account tokens.Bing tokenNot required.Usage📝This CLI app supports the following command-line arguments:-bor--bot: Choose the bot for the conversation. Valid options are provided by the application.
Example:python chatcli.py -b chatgpt-mor--message: Input a message for the chatbot.
Example:python chatcli.py -b sage -m "Hello, how are you?"For more info, use-hor--helpto see the help message.If you don't provide any command-line arguments, the app will prompt you to choose a bot and enter a message interactively.Once the conversation starts, you can continue the interaction by typing your messages or selecting options from the menu. The menu options include changing the bot or exporting the conversation to a .txt file.Notes📌If the app cannot find thetoken.txtfile or the file is empty, it will automatically generate a new token using thetoken_gen.pyin/aichat/token_genscript provided.The CLI app also supports the use of premium tokens , so you can be able to use GPT4.The conversation history is stored within the app and is not persistent between sessions.Feel free to customize and enhance the GPT CLI app according to your needs. Happychatting! |
ai-chatter | ai-chatterAboutAI is pretty cool, but a lot of fuss around it is just chatter.
This package tries to provide a toolkit to easily implement basic applications using ChatGPT, so you can get your hands dirty, and see whether you can do something useful with it.It automatically takes care of some issues around interacting with a chatbot, like settings and session management, data persistence, communication, and gluing it together.Installationpip install ai-chatterLicenseai-chatteris copyright (C) 2023 Fynn Freyer.This program is free software: you can redistribute it and/or modify it under the terms of theGNU Affero General Public Licenseas published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.You can find a copy of the GNU Affero General Public Licensealong with this program.
You can also get a copy online athttps://www.gnu.org/licenses/. |
ai-chat-tool | AI-Chat-ToolAI-Chat-Tool is a tool that brings ChatGPT to the command line.To use this tool you will need a ChatGPT api key.Options--api-key(required) ChatGPT api key to use to access ChatGPT.--file(optional) File to write ChatGPT response to. Pass just the file(test.py) or the path and file(/first_dir/second_dir/test.py)--max-tokens(optional) The maximum number of tokens to generate in the completion. Default=7--temperature(optional) What sampling temperature to use. Default=0--line(optional) Line on a file where ChatGPT output will start.ExampleUse AI-Chat-Tool to create a Python function that checks for even numbersCLIpython -m ai-chat-tool --api-key=$CHATGPTKEY --file=test.py --max-tokens=2000 --line=4What can I do for you today?: Can you create a python function that checks for even numbers?
Text written to test.pyFile created by AI-Chat-Tooltest.pydefcheck_even(number):ifnumber%2==0:returnTrueelse:returnFalse |
aichopen-tools | aichopen-toolsRepository containing tools used by the AI-TeamJsonLoader: tool to load and dump json into filesLoggerFactory: tool to create a preconfigured logger using the singleton patternMake package publicly pip installableGenerate the distribution archivespython3-mpipinstall--upgradebuild
python3-mbuildUpload to TestPyPIpython3-mpipinstall--upgradetwine
python3-mtwineupload--repositorytestpypidist/*InstallationLocalFirst installpipinstall.If you have an existing install, and want to ensure package and dependencies are updatedpipinstall--upgrade.or pip uninstall aichopen-toolsRemoteFirst add your ssh key on GitHub and then pip install the repository as shown below:pipinstallgit+https://[email protected]/echOpen-factory/aichopen-tools.gitUsagefrom aichopen_tools.json_loader import JsonLoader
from aichopen_tools.logger import LoggerFactoryAdditionalYou can find examples of issue and pull requests templates in the directory .github |
aicli | Assisted installer assistant |
aiclib | A declarative system to consume the NVP api.Current Build StatusUse of AIC wrapper libThe AIC wrapper command, or sentence, consists of two
parts:
- An object and its parameters
- A verb that acts on that objectTypical use looks as follows:
library.[possible parameters].object.[params].verbIt is possible for the object to be a collection of the
same type of object. The AIC wrapper lib will perform a
bulk operation on all of the objects.If an object is not given it is assumed that the user
wishes to create an object (this is finalized through the
CREATE verb).Object’s parameters are completely optional if they are
set through a ‘dot’ function. Parameters that are required
are set during the declaration of the object.A verb works on the object and is always the last portion
of a normal command.Querying using the wrapper libThe exception to the normal command pattern is when a user
wishes to query. A query works much like the typical use
but acts works as a modifer to the verb (an adverb).Typical query use is as follows:
library.[params].object.query.[params].verbThe object stated in the command is what query is looking
for. Parameters may be passed to the query to make the
search more precise.Extending the wrapper libThe creation of a custom entity requires that the entity,
somewhere in its inheritance chain, inherit from
core.Entity. For it to properly return responses from the
server it also needs to overload unroll. |
aiclient | Failed to fetch description. HTTP Status Code: 404 |
aiclipal | ai-assistantSmall terminal AI CLI pal for generating content.InstallationInstallaiclipal:pip install -U aiclipalUsageJust run from the command line. By default you need to have theAI_CLI_PAL_OPENAI_API_KEYenvironment variable exported to the command line containing your API key for OpenAI.Then runaiclipal -hto get more informationCopyrightCreated by Grzegorz Grzęda. Distributed under MIT license |
aicloud | aicloud |
aicloud-deploy | Toolkit AI Cloud для написания скриптов деплоя в Inference |
aicloud-test | No description available on PyPI. |
aicloudx | aicloud配合云平台使用,如果不在平台内部,程序包没有效果编译安装需要的软件: python3 -m pip install --user --upgrade setuptools wheel twine编译:python3 setup.py sdist bdist_wheel上传到测试服务器:python3 -m twine upload --repository-urlhttps://test.pypi.org/legacy/dist/aicloud-0.0.2-py3-none-any.whl安装:python3 -m pip install --index-urlhttps://test.pypi.org/simple/--no-deps aicloudx上传正式服务器:python3 -m twine upload dist/aicloudx-0.0.2-py3-none-any.whl安装:python3 -m pip install --no-deps aicloudx创建存放公共数据的bucket:mc mb minio/tfdatasets设置权限:mc policy set download minio/tfdatasets上传数据: mc cp --recursive tensorflow_datasets minio/tfdatasets |
aiclub | aiclub: Navigator ClientThis is the navigator client package to connect and interact with Navigator |
aicmder | Wait for updated |
aicns-auto-release-test | No description available on PyPI. |
aicns-feature-metadata | No description available on PyPI. |
aicns-raw-data-loader | No description available on PyPI. |
aicns-univariate-analyzer | No description available on PyPI. |
ai-coach-xblock | AI Coach XBlockAI Coach Xblock helps learner in improving their answers by levering power of AI. It evaluates open response answer of a question using Open AI and provides feedback to learner.It has the followig features:Helps learner to get feedback on their open response answer using Open AILearner can improve answer on the basis of Open AI feedbackAbility to mark Question complete in open edXSave learner answer which can be retrieved laterSetuppipinstallai-coach-xblockUpdate Settings of LMS and CMSAdd the OPEN AI secret key in the lms and cms configuration fileOPENAI_SECRET_KEY='set-secret-key'Update Advanced Settings of courseUpdate course advanced settings by addingai_coachas shown in below imageUpdate settings of AI Coach ComponentAI Coach Xblock will be available in Advanced component of course unit now. Add "AI Coach" xblock in unit and click "Edit" button to
addquestion&question contextand configure it.Contextis the context of question with answer which is provided to OpenAI for feedback generation. Question and Learner Answer is integrated into context using{{question}}and{{answer}}keywords which automatically picks question & learner aswer value.
Example:I am grade 8 student studying leadership. My teacher asked me question: {{question}} . I answered {{answer}} . Provide two tips to improve my answer as a grade 8 student.Publish ContentUse "Preview" button to preview it or publish your content and use "View Live Version" button to see how it appears on LMSAsk For FeedbackAfter adding answer, learner click onAsk from Coachbutton for feedback. Feedback is provided by OPEN AI on the basis of question context and answer.Setting the feedback thresholdThe feedback threshold represents the maximum number of times a learner can request feedback. You can configure the feedback threshold by accessing the AI Coach Component settings in the CMS.The tooltip which appears when hovering over theAsk from coachbutton represents the chances to request feedback from AI Coach.Once all available chances to request help from the coach have been utilized,Ask from coachbutton will be disabled and learners will see the following message on tooltip: "You have exhausted all available opportunities to seek guidance from the coach."Submitting AnswerSubmit button saves the learner answer and mark the completion of Xblock. |
aiCode | aiCode: AI-Assisted/Automated Coding |
aicodebot | AI Code Bot 🤖Your AI-powered coding sidekickAICodeBot is a coding assistant designed to make your coding life easier. Think of it as your AI version of a pair programmer. Perform code reviews, create helpful commit messages, debug problems, and help you think through building new features. A team member that accelerates the pace of development and helps you write better code.We've planned to build out multiple different interfaces for interacting with AICodeBot. To start, it's acommand-line toolthat you can install and run in your terminal, and aGitHub Action for Code Reviews.Status: This project is in its early stages, but it already improves the software development workflow, and has a healthy roadmap of features (below).We're using AICodeBot to build AICodeBot, and it's upward spiraling all the time.️ We're looking for contributors to help us build it out. SeeCONTRIBUTINGfor more.Current features - how you can use it todayTaskStatusGenerating quality commit messages✅Thinking through tasks as a pair programmer✅Coding with a small number of files✅Debugging✅Doing code reviews✅Explaining code✅Writing tests✅Integration with GitHub✅Modifying local filesEarly stagesSearching the internet for answersIn ProgressReading library documentationEarly stagesCoding with a large number of filesAs LMs get larger token limitsWriting senior developer level codeEventuallyMajor refactorsEventuallyBuild entire appsEventuallyReplace DevelopersNopeAI Sidekick 🦸♂️aicodebot sidekickYour AI-powered coding assistant. It's designed to help you with your coding tasks by providing context-aware suggestions and solutions. Think ChatGPT with the ability to read the local repository for context.By default it will pass along a directory of files from the current working directory, and you can also pass in a list of files to use as context for the task you are working on. For example:aicodebotsidekickfile1.pyfile2.pyIn this example, the sidekick will read the contents of file1.py and file2.py and use them to provide context-aware answers.Pro-tips:Add your README.md to the list of files to get context-aware answers.Paste in error messages from log files or stack traces and it will help you debugBrainstorm new featuresHave it write unit tests for you that cover all the casesThis feature is in its early phases right now, but it's already useful. We'll be adding support for tools that the sidekick can use, including GitHub integration, ingesting repository specific domain knowledge, writing local files, and more. For now, it justreadsfiles and provides suggestions.AI-Assisted Git Commit 📝aicodebot commitimproves the git commit process. It will run pre-commit for you to check syntax, and then generate a commit message for you based on the changes you've made. In about as much effort as typing "fix bug" for the commit message, you will get a high-quality commit message that thoroughly describes the change.AI-Assisted Code Review 👀aicodebot reviewwill run a code review on your code and suggest improvements. By default, it will look at [un]staged changes, and you can also supply a specific commit hash to review.
Its goal is to suggest how to make the code better, and we've found that it often teaches us new things about our code and makes us better programmers. It is a great way to get a second set of robot eyes on your code.AI-Assisted Debugging 🐞aicodebot debug $commandwill run the $command and capture the log output. It will pass the error message, stack trace, command output, etc. over to the AI and respond with some suggestions on how to fix it.Installation and UsageTo install AICodeBot, run:pip install aicodebotAnd then, runaicodebot configureto get started.Usage:aicodebot[OPTIONS]COMMAND[ARGS]...
Options:-V,--versionShowtheversionandexit.-h,--helpShowthismessageandexit.-d,--debugEnablelangchaindebugoutput
Commands:alignmentAmessagefromAICodeBotaboutAIAlignment❤+🤖.commitGenerateacommitmessagebasedonyourchanges.configureCreateorupdatetheconfigurationfiledebugRunacommandanddebugtheoutput.reviewDoacodereview,with[un]stagedchanges,ora...sidekickCodinghelpfromyourAIsidekickOpen AI key setupThe first time you run it, you'll be prompted to enter your OpenAI API Key, which is required, as we use OpenAI's large language models for the AI. You can get one for free by visiting yourAPI key settings page.Note: You will be billed by OpenAI based on how much you use it. Typical developers will use less than $10/month - which if you are a professional developer you'll likely more than make up for with saved time and higher quality work. SeeOpenAI's pricing pagefor more details. Also, see the note about increasing your token size and using better language models below.Integration with GitHub ActionsHow about automated code reviews on every commit? You can have AICodeBot run as a GitHub action on your repository. SeeThe AICodeBot GitHub Action for Code Reviews. It will look at every commit and pull request, and then either:✅ Pass🗒️ Comments - pass the action, but leave a comment with minor issues, suggestions, or improvements.❌ Fail the action - if a serious issue is found, it will leave a comment and let you know about something that should be addressed.Roadmap of Upcoming Features ️Code Workflow ImprovementsAssisted Git Commit: Automatically generate a commit message based on the changes you've madeAssisted Debugging: Run a command with aicodebot and it captures the log message and tries to figure out what's going on from the error message. Eventually, it could also suggest fixes for the error and make the changes for you. Try it out withaicodebot debug $commandCode Review: Provides feedback on potential issues in code, and suggests improvements to make it better.Dependency Management: Updating dependencies to their latest versions with pull requests that run tests.Documentation Generation: Generates comprehensive documentation for code, including docstrings, README files, and wiki pages.Performance Optimization Suggestions: Suggests potential performance optimizations for code.Test Generation: Generates unit tests for code, improve test coverage.Integration with CI/CD pipelines: Integrates with CI/CD pipelines to automate tasks like code review, testing, and deployment (via GitHub Actions). Eventually: Fix the build automatically when there are small errors.Rubber Ducky Chat Bot: Helps developers think through design issues by providing a conversational interface to discuss and solve problems, using data from the current repository.Linting/Formatting: Checks code for linting errors and automatically fixes them where possible (via pre-commit)Automatically Generate ChangeLogs and Release Notes: Generates release notes and changelogs based on commit messages and code changes.User InterfacesCommand-line, installable via pip: aicodebot can be installed as a Python package usingpip install aicodebotMention the @aicodebot GitHub user: Mentioning the@aicodebotGitHub user in a comment will trigger it to perform a task, review code, or pull in an appropriate GIF.Callable as a GitHub action: Can be called as a GitHub action to perform tasks on GitHub repositories.AICodeBot ActionJupyter Notebook Extension: Provides a Jupyter Notebook extension that can be used to debug code in the notebook.Chat: CLI chat interface that knows the context of your codebase and can answer questions about it. No more going back and forth between ChatGPT and command-line.Slack Bot: Interacts with aicodebot via slack, sends notifications, performs tasks, and provides real-time assistance to developers.Bug Report service integrations: Listen for bug reports from Sentry,Honeybadger, and other bug reporting tools and automatically create issues, assign them to developers, and notify them via Slack. Eventually: FIX the bug automatically and notify the team.Repository / Project ManagementProject best practices: Suggest things like pre-commit, linting, license, CI/CD, etc. Eventually: Implement them for you.Manage GitHub Issues: Provides Level 1 triage of incoming issues on GitHub, including tagging, assigning, and responding with FAQs. It could also escalate issues to human developers when necessary, and provide nudges for tasks that need more input.Welcome new contributors: Automatically welcome new contributors to the project, find out what they're interested in, and suggest issues for them to work on.FunAlignment: Gives a heart-centered inspirational message about how we can build AI in a way that aligns with humanity. Try it out withaicodebot alignment.Telling Jokes: We've gotta figure out how to teach language models about humor. :)Supportive Encouragement: High fives and kudos for a job well doneGIF Reactions: Reacts to messages with relevant and fun gifs.Alignment ❤️ + 🤖Technology itself is amoral; it just imbues the values of the people who create it. We believe that AI should be built-in a way that aligns with humanity, and we're building AICodeBot to help us do just that. We're building from a heart-centered space, and contributing to the healthy intersection of AI and humanity.What it's NOTaicodebotis a tool for developers, not a replacement for them. It's not going to replace your job, but it will make your job easier and more fun. It won't take over the world, but it will help us build a better one. See theAlignmentsection below for more.⚠️ AICodeBot currently uses OpenAI's ChatGPT large language models, which can hallucinate and be confidently wrong. Sometimes AICodeBot does dumb things, so it's mostlyreadingandadvisingand not yetwriting. Much like Tesla's "Full Self Driving", you must keep your hands on the wheel.It's also not a "build a site for me in 5 minutes" tool that takes a well-constructed prompt and builds a scaffold for you. There areother toolsfor that. It's not a no-code platform. Instead, AICodeBot is built to work with existing codebases and the git-commit level. It's designed to multiply the effectiveness of capable engineers.Configuring the language model to useNot all OpenAI accounts have GPT-4 API access enabled. By default, AICodeBot will use GPT-4. If your OpenAI account supports it, we will check the first time you run it. If your OpenAI API does not support GPT-4, you can ask to be added to the waitlisthere. In our testing, GPT-4 is the best model and provides the best results.To specify a different model, you can set thelanguage_modelin your$HOME/.aicodebot.yamlfile. For example:openai_api_key:sk-*****language_model:gpt-3.5-turbopersonality:Stewieversion:1.2You can also use openrouter.ai to get access to advanced models like GPT-4 32k and Anthropic's 100k model for larger context windows. Seeopenrouter.aifor more details. Here's a sample config:openai_api_key:sk-*****openrouter_api_key:sk-or-****language_model_provider:OpenRouterlanguage_model:openai/gpt-4-32k# or anthropic/claude-2 for 100k token limitpersonality:Stewieversion:1.2Note: We'll be adding more options for AI models in the future, including those that can be run locally, such asGPT4alland HuggingFace'sTransformers.Understanding Tokens and Using Commands EfficientlyIn AI models like OpenAI's GPT-4, a "token" is a piece of text, as short as a character or as long as a word. The total tokens in an API call, including input and output, affect the cost, time, and whether the call works based on the maximum limit.Each model has a maximum token limit. For example, GPT-3.5 has a limit of 4096 tokens, and GPT-4 has a token limit of 8192 tokens. If a conversation exceeds this limit, you must reduce your text until it fits.When using commands like the Sidekick command in AICodeBot, which allows you to pass in files for context, it's important to manage your tokens effectively. Due to token limits, it's not feasible to load your entire codebase. Instead, you should only load the specific files that are relevant to the task you're working on. This ensures that the AI model can process your request efficiently and provide the most relevant suggestions for your current task.How can I get a larger token limit?Do you need a larger context window for your task? Are you running into token limits and getting a message like this?Thecontextistoolarge(21414)foranyofthemodelssupportedbyyourAPIkey.😞There are a couple of things you can do:Load fewer files into the context (only what you need to work with)Apply for GPT-4-32k access from OpenAI by contacting them.Use openrouter.ai - this allows you to use the full power of GPT-4-32k, which offers a 4x larger context window. Seeopenrouter.aifor more details. Once you sign up and set youropenrouter_api_keyin your$HOME/.aicodebot.yamlfile, you can have access to larger models. Soon we will have support for Claude 2, which has a 100k token limit.Development / ContributingWe'd love your help! If you're interested in contributing, here's how to get started. SeeCONTRIBUTINGfor more details.DockerAssumes you have changes in current working dir that are already added.docker build -t aicodebot .
docker run -v ~/.aicodebot.yaml:/home/user/.aicodebot.yaml -v .:/app aicodebot commit -y |
ai-code-fixer | Failed to fetch description. HTTP Status Code: 404 |
aicoder | No description available on PyPI. |
ai-code-reviewer | AI code reviewerAI tool for automated code review. It is designed to review you code changes (for example before commit or creating pull request) for programming principles you specify. You have to provide coding principle you are interested in by populating.coding_principlesfolder in your repo and then GPT-4-Turbo model will check your changed files for these principles. The tool has CLI (similar to flake8).Pricing warning:ai_code_reviewer uses openai GPT-4-Turbo model for review which is quite expensive. You need toset up OPENAI accountand will be charged there based on the model usage.For example, checking single 100-lines long file with single 100-lines long principle will cost you around 0.03$.To reduce price ai_code_reviewer reviews only changed files and ignores unchanged ones. But if the file is changed, all of its lines will be processed by reviewer, so be careful running ai_code_reviewer if your files are very long. Also, only.pyfiles will be reviewed.For example, if you are checking for 5 principles and have changed 20 files, each ai_code_reviewer run would cost around 3$Plan your budget accordingly, developers of ai_code_reviewer are not responsible for your unexpected expenses.Usage with command lineGet your OPENAI_API_KEY fromhttps://platform.openai.com/api-keyspip install ai_code_reviewercd to you git repository dirRoot of your repository should contain non-empty.coding_principlesfolder. Populate it with coding principles you want to check for during code review. You can copy principles fromthe library of ready to use coding principlesor create your own by creating a new file withproper format.Run ai_code_reviewer:To check not committed changed files run in terminalOPENAI_API_KEY=sk-your-openai-key ai_code_reviewerTo check you local code version compared to some specific repository revision (for example, before creating pull request):OPENAI_API_KEY=sk-your-openai-key ai_code_reviewer --compare_with origin/developPrivacyai_code_reviewer does not collect or process your code. Your code will be directly uploaded to openai api using your api key.Check their privacy termsbefore using ai_code_reviewer with sensitive content.Custom-principlesThe idea of ai_code_reviewer is to be highly customisable and check only those principles you need. So if you have tried some ready-to-use principle, but it did not work for you (for example it does not review where you want it to review or otherwise, reviews code you consider good), we encourage you to modify principle file, fine-tuning it for your needs.The principle is.yamlfile consisting of following fields:principle_nameprinciple_description - here describe what you want this reviewer to check.review_required_examples - provide examples when you want this reviewer to triggerreview_not_required_examples - provide negative examples, when you do not want it to reviewContributionIf you like the project you could donate you time or money for its development.Sponsor buttonworks and if you want to contribute your code, lets communicate via [email protected] planCLIProject structure understandingGitHub pull request reviewer botGitLab merge request reviewer botPyCharm pluginLICENSEThe ai_code_reviewer is subject of custom license terms, check license file for details. But in short, you can use it to review code of only non-commercial open-source projects. To use it for commercial code, contact me by [email protected] |
ai-codesign | No description available on PyPI. |
aicoe-donkeycar | donkeycar: a python self driving libraryDonkeycar is minimalist and modular self driving library for Python. It is
developed for hobbyists and students with a focus on allowing fast experimentation and easy
community contributions.NOTE: this package is a non-official build by the AICoE. Please check the upstream project links for official information.Quick LinksDonkeycar Updates & ExamplesBuild instructions and Software documentationDiscord / ChatUse Donkey if you want to:Make an RC car drive its self.Compete in self driving races likeDIY RobocarsExperiment with autopilots, mapping computer vision and neural networks.Log sensor data. (images, user inputs, sensor readings)Drive your car via a web or game controller.Leverage community contributed driving data.Use existing CAD models for design upgrades.Get driving.After building a Donkey2 you can turn on your car and go tohttp://localhost:8887to drive.Modify your cars behavior.The donkey car is controlled by running a sequence of events#Define a vehicle to take and record pictures 10 times per second.importtimefromdonkeycarimportVehiclefromdonkeycar.parts.cvimportCvCamfromdonkeycar.parts.tub_v2importTubWriterV=Vehicle()IMAGE_W=160IMAGE_H=120IMAGE_DEPTH=3#Add a camera partcam=CvCam(image_w=IMAGE_W,image_h=IMAGE_H,image_d=IMAGE_DEPTH)V.add(cam,outputs=['image'],threaded=True)#warmup camerawhilecam.run()isNone:time.sleep(1)#add tub part to record imagestub=TubWriter(path='./dat',inputs=['image'],types=['image_array'])V.add(tub,inputs=['image'],outputs=['num_records'])#start the drive loop at 10 HzV.start(rate_hz=10)Seehome page,docsor join theDiscord serverto learn more. |
aicoe-hello-world | A small example demonstrating Python package releases uploaded using AICoE-CI
to Operate First Pulp instance.How ToTo trigger a new package release to Pulp:Make sure you are stated as a maintainer of the package in.thoth.yamlfile (in “version” manager section)Trigger a new release by opening an issue - followKebechet version manager
documentation for more infoOnce the PR is opened and all CI checks pass, the pull request adjusting
version identifier is automatically mergedThe pipeline will release the Python package to the Pulp instance,
respecting.aicoe-ci.yamlconfiguration present in Git rootTo check progress, visitTekton on Operate First (PipelineRuns)and in the search bar type:project:<github-project-name>(e.g.project:aicoe-ci-pulp-upload-example) |
aicoe-tensorflow | No description available on PyPI. |
ai-commands | ai_commandsOverviewai_commandsis a Python package designed to simplify common AI-related tasks such as performing sentiment analysis on text data. It provides a collection of functions and utilities to streamline various AI tasks, making it easier for developers to work with artificial intelligence and natural language processing.FeaturesText Variation Generation: Use theai_similarisefunction to generate text variations by replacing words with synonyms and shuffling sentence structure.Sentiment Analysis: Employ theanalyze_sentimentfunction to perform sentiment analysis on text, providing sentiment labels and scores.InstallationYou can installai_commandsusing pip:pip install ai-commandsUsageHere's how you can use ai_commands in your Python projects:import ai_commands
# Generate text variations
original_message = "Sorry, you lost the game!"
similar_message = ai_commands.ai_similarise(original_message)
print("Similar Message:", similar_message)
# Perform sentiment analysis
text_to_analyze = "I love this product. It's fantastic!"
sentiment_result = ai_commands.analyze_sentiment(text_to_analyze)
print("Sentiment Analysis Result:", sentiment_result)DocumentationFor detailed usage instructions and additional functions, please refer to the documentation.Support and Contributionsai_commands is an open-source project, and contributions from the community are welcome! If you have ideas for improvements or new features, please check out our contribution guidelines.Licenseai_commands is licensed under the MIT License. |
aicommit | autocommitAI-Generated Git Commit MessagesIncludes two tools:commit.pyandscan_repo.pyInstall theaicommitcommand withpip install aicommitcommitAn interactive CLI tool that generates 5 commit message suggestions for all the changes in your current Git repo. After you pick and edit the commit message you want, it performs the commit.NOTE:it commits all changes, untracked and unstaged, in your current repo.On first run, it will prompt you for your OpenAI API key. Sign up for OpenAI if you haven't. Grab your API key by going to the dropdown on the top right, selecting "View API Keys" and creating a new key. Copy this key.scan_reposcan_reporuns through all the commits in your repository to generate a CSV with AI-suggested commit messages side-by-side with your original commit messages.To run scan_repo, copy.env.exampleto.envand add your OPENAI_KEY.To update the repo it runs on, modify theGITHUB_REPO_URLvariable at the top ofscan_repo.pyPublishing to pipVersion bump and clear outdist/python3 -m build
twine check dist/*
twine upload dist/* --verbose |
ai-commit-cli | AI-CommitA CLI that writes your git commit messages for you with AIDemoUsageUsage: aic [OPTIONS] [PATHSPEC]...
╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────╮
│ pathspec [PATHSPEC]... When pathspec is given on the command line, commit the contents of │
│ the files that match the pathspec without recording the changes │
│ already added to the index. The contents of these files are also │
│ staged for the next commit on top of what have been staged before. │
│ For more details, see the pathspec entry in gitglossary(7). │
│ [default: None] │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────╮
│ --exclude -e TEXT [default: None] │
│ --log [TRACE|DEBUG|INFO|SUCCESS| [env var: LOG_LEVEL] │
│ WARNING|ERROR|CRITICAL] [default: INFO] │
│ --log-file FILE [env var: LOG_FILE] │
│ [default: None] │
│ --pre-commit --no-pre-commit [default: pre-commit] │
│ --diff TEXT [default: None] │
│ --diff-file FILE [default: None] │
│ --spec --no-spec [default: spec] │
│ --model -m TEXT [default: None] │
│ --max-tokens INTEGER [default: 500] │
│ --temperature FLOAT [default: 0.2] │
│ --api-key TEXT [env var: OPENAI_API_KEY] │
│ [default: None] │
│ --install-completion [bash|zsh|fish|powershell| Install completion for the │
│ pwsh] specified shell. │
│ [default: None] │
│ --show-completion [bash|zsh|fish|powershell| Show completion for the │
│ pwsh] specified shell, to copy it │
│ or customize the │
│ installation. │
│ [default: None] │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ |
ai-commit-gen | Ai-Commit-GenAi-Commit-Gen is a Python binary that leverages OpenAI's language models to generate meaningful commit messages. There's approximately a thousand such binaries out there, but none that fit into all of my workflows, so here's the 1001st.ai-commit-gen can be called from scripts to automatically create commits, or integrated into editor workflows to create commit drafts.Installationpipinstallai-commit-genUsageai-commit-gen assumes that the current working directory is, or is a subdirectory of, the git root.-por--prompt: Override the default prompt for the OpenAI model.-cor--commit: Not only generate a commit message but also commit the changes in git.-mor--model: Specify the model to be used. The default is "gpt-3.5-turbo". The models "gpt-4" and "gpt-4-32k" are also supported.-dor--debug: Enable debug logging.OpenAI API KeyThe OpenAI API key can either be set as an environment variableOPENAI_KEY, or it can be stored in the system keyring, which is how I use it.If the key is not found in either of these locations when the script is run, you will be prompted to enter the key and given the option to store it in the keyring.ExampleHere is an example of how you might use Ai-Commit-Gen:# Stage your changesgitadd.# Just create the commit messageai-commit-gen# Generate a commit message and commit the changesai-commit-gen--commitIn the above example, Ai-Commit-Gen will consider the staged changes, generate a commit message using the OpenAI model, and directly commit the changes with the generated message.NotePlease make sure that you have the required permissions and credits to use the OpenAI API.ContributeFeel free to open an issue or submit a pull request if you have any issues or feature requests. |
ai-commits | An AI-powered git commit message generator written in python. Inspired by @NutlopeDescriptionAICommits is a Python script that generates a git commit message using OpenAI's GPT-3 language model. The script takes the git diff of the staged changes and generates a commit message using GPT-3.The generated commit message is presented to the user who has the option to accept or reject it. If the user accepts the commit message, the script commits the changes using the generated message.The script requires an OpenAI API key, which can be obtained from the OpenAI website.DependenciesPython 3.6 or higher
openai 0.10.2
inquirer 3.7.0
python-dotenv 0.19.1FeaturesIn this version, AICommit provides the following features:Automatic generation of commit messages based on the diff of staged changes.Support for conventional commit messages.Language selection for generated commit messages.User selection of generated commit messages.Support for specifying diff per file.Installation and UsageTo use AICommits, do the following:Export your OpenAI API key as an environment variable by running:exportOPENAI_API_KEY=YOUR_API_KEYinstall aicommit from pypi by running:pipinstallai_commitsThen, run the script using the commandaicommit.This will prompt AICOMMIT to generate up to 5 commit messages based on the diff of staged changes. The user can then select one of the generated commit messages to use as the commit message for their changes.If the --diff-per-file flag is included, AICOMMIT will generate separate commit messages for each file.If the --conventional flag is included, AICOMMIT will generate commit messages in conventional commit format.If the --language flag is included, AICOMMIT will generate commit messages in the specified language.Install from SourceTo install AICommits from source, follow these steps:Clone the repository using the command git clonehttps://github.com/nneji123/aicommit.git.Navigate to the project directory using the commandcd aicommit.Install the required dependencies by running pip install -r requirements.txt.Set your OpenAI API key as an environment variable by running export OPENAI_API_KEY=YOUR_API_KEY.Run the script using the commandpython "src/ai_commits.py".The script will prompt you to confirm the generated commit message. If you accept the message, the changes will be committed using the generated message.Changelogv1.0.0 (2023-02-16)Added support for generating commit messages in multiple languagesImproved performance when generating commit messages for large diffsAdded ability to select from multiple generated commit messages using the inquirer libraryFixed various bugs and improved error handlingv0.0.5 (2023-02-15)Fixed a bug that caused the script to fail when no changes were stagedv0.0.4 [Initial Release] (2023-02-15)Initial release of aicommitsSupports generating conventional commit messagesSupports generating commit messages based on the changes in the staged filesUses OpenAI's GPT-3 to generate commit messagesContributingOpen an issue or submit a pull request if you want to contribute to the project.LicenseMIT |
ai-common | Blank ai-common library. |
ai-common-woot | Failed to fetch description. HTTP Status Code: 404 |
ai-companion-py | Python bindings for ai-companion (only backend, without WebUI)It is not recommended to use it in your serious projects - I recommend usingai-companionor something elseAn example of using the library onGoogle ColabAn example of using the library inPython3 |
aicompleter | AI-CompleterA totally automatic AI to interact with environments.Now it only supports OpenAI API.SetupNote:Please use stable branch if the dev branch is brokenClone the Repositrygitclonehttps://github.com/AI-Completer/AI-Completer.gitcdAI-CompleterModify the config fileYou can use either vim or your editor to modify the fileconfig-example.json, and save it toconfig.jsonRun and enjoy yourselfNote: Use Python 3.11+ to run this program.python3-maicompletertalk--aibingai# This will start a conversation with bing ai.python3-maicompleterhelper--enable-agent--includepythoncode# This will start a helper with OpenAI APIYou can add custom interface to this program to add more function.Quick StartThe code below will start a talk with gpt, the detailed model varies with your configure, default is gpt-3.5-turbo.fromaicompleterimport*fromaicompleter.implementsimport*importasynciocfg=Config({# 'openaichat' is the namespace, you can change to your own namespace'openaichat':{'openai':{'api-key':'sk-...',# Put you OpenAI API key here'model':'gpt-3.5-turbo',# AI model, default is gpt-3.5-turbo}}})# ChatAI, use openai model gpt-3.5-turbo-0301chater=ai.openai.Chater(cfg['openaichat'])# Chat Interface, based on chater -> OpenAI APIchatinterface:ai.ChatInterface=ai.ChatInterface(ai=chater,namespace='openaichat')# Handler, interacting between interfaceshand:Handler=Handler(cfg)asyncdefmain():# Add Interfacesawaithand.add_interface(chatinterface)# Start a new sessionsession:Session=awaithand.new_session()print("Please start a conversation")whileTrue:# Get input from consoleword=input(">>> ")ifword=='exit':break# Send a ask command to the chat interface, the ai is asked by the content (text, the question of user)print(awaitsession.asend('ask',word))# Start the loopasyncio.run(main())ExamplesSeeexamplesDocumentReference:DocumentTo-do ListWe are adding more support to this program.Add Commands Intergation with AI model.Add Commands SupportAdd memory systemAdd HistoryAdd Memory AnalyseAdd Extra Interface Package |
aiconclave | aiconclaveThis package contains the python scripts for the AI conclave exhibition 2023.Command Prompt:pip install aiconclave && aiconclavePowershell:pip install aiconclave ; aiconclave |
aiconfig | configuratorPython configuration using yaml |
aiconfig-extension-gemini | Using Gemini with AIConfigWe are prioritizing the Python library UsageInstallpip install aiconfig-extension-geminiImport the extensionimport aiconfig_extension_geminiAnd you're all good to go! This extension automatically updates the model parser registry with the model "gemini-pro". Check out the Gemini Cookbook in the aiconfig repo for a full example. |
aiconfig-extension-hugging-face | This extension contains AIConfig model parsers with two main subfolders:local_inference: Loads models onto your machine and uses Hugging Face transformers and diffusors locally.remote_inference_client: Uses Hugging Face's InferenceClient API to connect to models remotelyUsagePart 1: Update and test this extensionIf you are not testing and developing locally (just using the published extension), ignore this and go to Part 2From theaiconfig/extensions/HuggingFace, run this command:pip3 install build && cd python && python -m build && pip3 install dist/*.whlLink your local dev environment to the current dir:pip3 install -e .. Afterwards if you dopip3 list | grep aiconfig, you should see this linked to your local path. If you ever wish to use the published extension, you will need to first remove the extension:pip3 uninstall aiconfig-extension-hugging-face && pip3 install aiconfig-extension-hugging-faceAfter you're done testing, be sure to delete the generated folder(s) in theaiconfig/HuggingFacedir. It'll probably look something likepython/distandpython/<package_name>.egg-infoPart 2: Importing and using this extensionpip3 install aiconfig-extension-hugging-faceImport the library to your code:from aiconfig_extension_hugging_face import <EXTENSION>.Import the AIConfig model registery:from aiconfig import ModelRegistryParserIn code, add all the relevant model parser objects that you want to use from this extension to the registry. Ex:ModelParserRegistry.register_model_parser(HuggingFaceTextGenerationTransformer()). You can read the docstrings underModelParserRegistryclass for more infoIn your AIConfig, add a fieldmodel_parserswith the model you want to use and the id of the extension you want to use: . Ex:https://github.com/lastmile-ai/aiconfig/blob/f1840995b7a12acba371a59ac3b8c69b3962fc68/cookbooks/Getting-Started/travel.aiconfig.json#L19-L22Now whenever you callaiconfig.run()these model parsers will be loaded and available! |
aiconfig-extension-llama | No description available on PyPI. |
aiconfig-extension-llama-guard | LLama Guard with AIConfigLLama Guard is a 7b model released by Meta. This extension allows you to use it with AIConfig.LLaMA Guard allows you to define your own “safety taxonomy” — custom policies to determine which interactions are safe vs. unsafe between humans (prompts) and AI models (responses). What makes this cool is that it allows you to enforce your own policiesON TOPof the standard guardrails that a model ships with (instead of merely overriding them).[!NOTE] This extension also loads the entire model into memory.Part 1: Installating, Importing, and using this extensionInstall this module: runpip3 install aiconfig_extension_llama_guardin terminalAdd these lines to your code:fromaiconfig_extension_llama_guardimportLLamageGuardParserfromaiconfig.registryimportModelParserRegistryIn code, construct and load the model parser that to from this extension to the registry:ModelParserRegistry.register_model_parser(LLamageGuard()). You can read the docstrings underModelParserRegistryclass for more info o nwhat this does.Use theLLamageGuardmodel parser however you please. Check out our tutorial to get started (video walkthrough,Jupyter notebook) You can watch our video tutorial or check our Jupyter notebook tutoPart 2: Updating & Developing this extensionIf you are not developing this extension locally (just using the published extension), feel free to ignore this partNavigate toextensions/LLama-Guard/pythonand run this command:pip3 install -e .(this creates a local copy of the python module which is linked to this directory)Edit and test the extension as you please. Feel free to submit a push request on GitHub!After you're done testing, be sure to uninstall the local link to this directory if you ever want to use the published version:pip3 uninstall aiconfig_extension_llama_guard |
aiconsole | No description available on PyPI. |
aicooking-ble | Aicooking BLEManage Aicooking BLE devicesAicookingShenzhen chuangxinlian Electronics CXL001Tesla Cook BBQ100 (CXL001-Y)InstallationInstall this via pip (or your favourite package manager):pip install aicooking-bleContributors ✨Thanks goes to these wonderful people (emoji key):This project follows theall-contributorsspecification. Contributions of any kind welcome!CreditsThis package was created withCopierand thebrowniebroke/pypackage-templateproject template. |
aicore | AI Core teaching libraryThis library provides materials used for various parts
ofAI Corecourses. |
ai-core | No description available on PyPI. |
aicore-cloudword | No description available on PyPI. |
aicore-hangman | No description available on PyPI. |
aicore-nb | Teaching ToolsRunpython aicore_nb_toolin your terminal and let the magic happen.You can also install the package to work in any directory and without worrying about dependencies. Simply runpip install aicore-nb-tools, and once installed runpython -m aicore_nb_tool. It will ask you for the API token, please, ask the team how to get one.The script connects to an S3 bucket with the questions. Those questions are stored usign the lesson id, and in order to get those ids, it connects to an RDS to make a query to check it. |
aicore-nb-tools | Teaching ToolsTool for generating questions and answers for students.The script connects to an S3 bucket with the questions. Those questions are stored usign the lesson id, and in order to get those ids, it connects to an RDS to make a query to check it.InstallationRunpython aicore_nb_toolin your terminal and let the magic happen.You can also install the package to work in any directory and without worrying about dependencies. Simply runpip install aicore-nb-tools, and once installed runpython -m aicore_nb_tool. It will ask you for the API token, please, ask the team how to get one.UsageYou can pass the API token as an argument to the tool, for example:python -m aicore_nb_tool --token <token>The module also accepts the following arguments:-p, --pathway: Pathway of the cohort that is going to be askedThe argument uses regex, so anything similar to the name of the pathway will work. For example-p Sciencewill matchData Science-ng, --no_groups: Whether to create groups or notSo for example, if you want to generate a notebook for the Data Science Pathway with no defined groups, you can run:python -m aicore_nb_tool --pathway Science --no_groups --token <token> |
ai-core-sdk | SAP AI Core SDKThe SAP AI Core SDK is a Python-based SDK that lets you access SAP AI Core using Python methods and data structures. It provides tools that help you to manage your scenarios and workflows in SAP AI Core.The SAP AI Core SDK can be used to interact with SAP AI Core. It provides access to all public lifecycle and administration APIs.For example:You can execute pipelines as a batch job to preprocess or train your models, or perform batch inference.You can deploy а trained machine learning model as a web service to serve inference requests with high performance.You can register your own Docker registry, synchronize your AI content from your own git repository, and register your own object store for training data and trained models.You can log metrics within a workflow execution using the SDK. You can use the same code for tracking metrics in both your local environment and in the workflow execution (production).NoteNote that executing online inference is not part of SAP AI Core SDK.Metrics persistence is not currently available in your local environment using the SDK. However, it is available in your productive workflow execution.Example UsageThe SDK can, for instance, be used in a Jupyter notebook for convenient interaction with SAP AI Core in a test or development context.Here are a few examples how to use the SDK. For details on the methods, please refer to the html documentation provided in the/docsfolder of the wheel file.Import Definitionsfromai_core_sdk.ai_core_v2_clientimportAICoreV2ClientCreate ClientThe SDK requires credentials from your tenant's subaccount Service Key:client=AICoreV2Client(base_url=AI_API_BASE,auth_url=AUTH_URL,client_id=CLIENT_ID,client_secret=CLIENT_SECRET,resource_group=resource_group_id)(For persistent client configuration see below.)Create New Resource Groupresource_group_create=client.resource_groups.create(resource_group_id=resource_group_id)print(resource_group_create.resource_group_id)resource_group_details=client.resource_groups.get(resource_group_id=resource_group_id)print(f"{resource_group_details.status_message}\n{resource_group_details.resource_group_id}")Create Object Store Secret# access key and secret are assumed to reside in environment variables OSS_KEY and OSS_SECRETobject_store_secret_create=client.object_store_secrets.create(name="default",type="S3",bucket="<your S3 bucket>",endpoint="<your S3 host>",path_prefix="<your path prefix in S3>",region="<your S3 region>",data={"AWS_ACCESS_KEY_ID":os.environ.get("OSS_KEY"),"AWS_SECRET_ACCESS_KEY":os.environ.get("OSS_SECRET")})secret_get=client.object_store_secrets.get(name="default")print(f"{secret_get.metadata}")List Scenariosscenarios=client.scenario.query()forscenarioinscenarios.resources:print(f"{scenario.name}{scenario.id}")Client ConfigurationThere are different options to persist the client credentials
(in this order of precedence):in code via keyword arguments (see above),environment variables,profile configuration file.Aprofileis a json file residing in a config directory,
which can be set via environment variableAICORE_HOME(the default being~/.aicore/config.json).The commandai-core-sdk configure --helpcan be used to generate a profile.With profile names one can switch easily between profiles e.g., for different (sub)accounts.
The profile name can be passed also as a keyword. If no profile is specified, the default profile is used.AICore Content Packagesai-core-sdk provides a command-line utility as well as a python library to use AICore content packages.InstallationThe content functionality should be installed as an optional dependency of ai-core-sdk:pipinstallai-core-sdk[aicore-content]Content packages use Metaflow's Argo Workflows plugin to generate templates for AICore and hence Metaflow should be also configured.
Run a configuration wizzard:metaflowconfigurekubernetesor create a simple configuration file~/.metaflowconfig/config.jsonwith a link to the configured in AICore object store:{"METAFLOW_DEFAULT_DATASTORE":"s3","METAFLOW_DATASTORE_SYSROOT_S3":"s3://<bucket>/<prefix>"}SeeConfiguring Metaflowfor more details.Discover Content Packages and their ContentCLIEcho descriptions of all packages from all registires:aicore-contentlistTo add custom content package spec the environment variableAI_CORE_CONTENT_SPECS(.envfile is also supported ) or the-c <path to content spec py/yaml>option can be used:aicore-content-cai_core_content_spec.pylistexportAI_CORE_CONTENT_SPECS=$PWD/ai_core_content_spec.py&&aicore-contentshowecho"AI_CORE_CONTENT_SPECS=$PWD/ai_core_content_spec.py">>.env&&aicore-contentshowPythonAll packages:fromai_core_sdk.contentimportget_content_packages# function to fetch a list of all packages from all registriesforcontent_pkginget_content_packages().values():content_pkg.print()# print more details for each packageThe content specs can also be used directly:fromcontent_package.ai_core_content_specimportpackage_spec_objpackage_spec_obj.print()A content packages consists of multipleworkflows.Workflowscan be AI CoreExecutionsorDeployments.CLIList of all workflows available:aicore-contentlist<nameofthepackage>Details of a specific workflow:aicore-contentshow<nameofthepackage><nameoftheworkflow>PythonAll packages:fromai_core_sdk.contentimportget_content_packages# function to fetch a list of all packages from all registriespackage=[*get_content_packages().values()][0]# Get a ContentPackage objectworkflows=package.workflows# get all workflows from a packageforflowinworkflows:flow.print(compact=True)# Print a compact description of the workflowforflowinworkflows:flow.print(compact=False)# Print a detailed description of the workflow.When usingpythona package can also directly used from theContentPackagefile without registering:# Load the object from the submodulefromcontent_package.ai_core_content_specimportpackage_spec_obj[*package_spec_obj.workflows.values()][0].print(compact=True)# create the object from content package spec yamlfromai_core_sdk.contentimportContentPackagepackage_spec_obj=ContentPackage.from_yaml('<path to package spec yaml>')[*package_spec_obj.workflows.values()][0].print(compact=True)# load content package specs from .py filefromai_core_sdk.contentimportget_content_packages_from_py_filelist_of_package_specs=get_content_packages_from_py_file('<path to package spec py>')# a .py file can contain multiple package specsforpackage_spec_objinlist_of_package_specs:[*package_spec_obj.workflows.values()][0].print(compact=True)User's workflow configurationEvery AICore template has a section with a user-specific information, i.e. scenario, docker repo, secret names, etc. To generate a template from a content package with user settings, user should create aworkflow configuration. This is a yaml file with a following structure:.contentPackage:my-package
.workflow:my-package-workflow
.dockerType:gpu
name:"my-executable-id"labels:scenarios.ai.sap.com/id:"my-scenario-id"ai.sap.com/version:"0.0.1"annotations:scenarios.ai.sap.com/name:"my-scenario-name"executables.ai.sap.com/description:"My description"executables.ai.sap.com/name:"my-executable-name"image:"my-docker-image"imagePullSecret:"my-docker-registry-secret"objectStoreSecret:"default-object-store-secret"In this config the target content package and workflow can be referenced using the keys.packageand.workflow. If provided those references are used to create the image and template. If not provided the package and the workflow have to be specified with--packageand--workflowoptions (see following sections for details).Create Docker imagesTo run an execution or start a deployment, at least one docker image is needed. Required docker images could be generated through the CLI/Python calls. Both run adocker buildinternally.CLITo create docker images:aicore-contentcreate-image[--package=<packagename>][--workflow=<workflowname>]<workflowconfig>The command-line options--packageand--workflowoverwrite valudes from the worfklow config.The building process has to be followed by adocker push -t <generated-image>to push the container to the registry.PythonThe workflow objects got a function.create_image(...):workflow=content_package_spec_obj['batch_processing']# fetch the workflow object using its namedocker_tag='my-very-own-docker.repo/sap-cv-batch-processing:0.0.1'workflow_config='my-config.yaml'withopen(workflow_config)asstreamworkflow_config=yaml.load(stream)cmd=workflow.create_image(workflow_config,return_cmd=True)# perform a dry run and return the cmdprint(cmd)workflow.create_image(workflow_config)# actually build the docker containeros.system(f'docker push{workflow_config["image"]}')# push the containerCreate AI Core TemplatesThe template creation is similar for Execution and Deployment templates.Create Execution TemplatesTo create execution templates themetaflow argo pluginis used.CLIWorkflow templates need a workflow config to be provided to thecreate-templatesubcommand.aicore-contentcreate-template[--package=<packagename>][--workflow=<workflowname>]<workflowconfig>-o<pathtooutputtemplate.json>PythonThe workflow config for execution templates has to be provided to the workflows's.create_template(...)function. The output file can be specified through the keyword parametertarget_file:workflow.create_template('my-workflow-config.yaml',target_file='workflow-template.json')Additonal OptionsAdditional arguments can be defined in the workflow config under the keyadditionalOptions....additionalOptions:workflow:# list of strings passed as workflow options...metaflow:# list of strings passed as metaflow options---package-suffixes=.py,.shStrings in theworkflow/metaflowpasted into these positions:python-mflow[metaflow]argocreate[workflow]To check the resulting call an--dry-run(CLI)/return_cmd=True(Python) option is availble. Alternativly the subcommandaicore-content <package name> metaflow-cli <workflow name>orworkflow.raw_metaflow_cli(...). Every input after the command is directly passed to the underlyingpython -m <flow>call.Create Serving TemplatesCLIServing templates also need aworkflow configto be passed to thecreate-templatesubcommand.aicore-contentcreate-template[--package=<packagename>][--workflow=<workflowname>]<workflowconfig>-o<pathtooutputtemplate.yaml>PythonThe workflow config has to be provided to the workflows's.create_template(...)function. The output file can be specified through the keyword parametertarget_file:workflow.create_template('my-workflow-config.yaml',target_file='serving-template.yaml')Content Package CreationA content package needs two additional files: theContentPackagefile and a workflows yaml.ContentPackageContent package are defined in aContentPackageinstance. This instance can either be loaded from a.pyfile or can be created from a yaml. A typical.pyfile looks like this:importpathlibimportyamlfromai_core_sdk.contentimportContentPackageHERE=pathlib.Path(__file__).parentworkflow_yaml=HERE/'workflows.yaml'withworkflow_yaml.open()asstream:workflows=yaml.safe_load(stream)spec=ContentPackage(name='my-package name',# name of the package and the aicore-content cli subcommandworkflows_base_path=workflow_yaml.parent,# Base paths for all relative paths in the workflow dictworkflows=workflows,description='This is an epic content package.',# Package descriptionexamples=HERE/'examples',# Folder to package related examples [optional]version='0.0.1'# Version of the package)If the package is to be distributed as a python module via Nexus or PyPI and the content package spec python file should be included in the package asai_core_content_spec.py. This allows the CLI to find the package without additional configuration efforts and creates a subcommand using the name from theContentPackage.nameattribute.ExamplesExamples for the content package can copy by the consumer to a directory using the commandaicore-content examples <package name> <target folder>. This command creates the target folder and copies all files from the paths set in theContentPackage. If no path is set or the path does not exists theexamplessubcommand is not created.VersionCurrently the version in theContentPackageis passed to the docker build call as--build-arg pkg_version==={version}. In theDockerfilethis build argument can be used to build the docker container using the local version of the package. This is useful for content packages distributed as module through Nexus or PyPI:FROMpytorch/pytorchARGpkg_version=ENVpkg_version=$pkg_version...RUNpython-mpipinstallsap-computer-vision-package${pkg_version}Workflows FileThe second mandatory file a workflows yaml. This yaml is used to define workflows and is structed like a dictionary:
Entries of the dict look like this:name-of-the-workflow:description:>Description text [optional]dockerfile:...type:ExecutionMetaflow/DeploymentYAML[... more type specific fields]It is important that all paths in the workflow yaml are specified as paths relative to the workflow yaml`s path. This also means that all files must be located in the same folder or in subfolders.DockerfilesThe dockerfile entry can either be a single:dockerfile:train_workflow/Dockerfileor a dictionary of paths:dockerfile:cpu:train_workflow/Dockerfilegpu:train_workflow/DockerfileThis allows to define different Docker container for different node types or multiple containers for cases where different steps use different containers. The different dockerfile can be selected using the option/argumentdocker_typewhen running the build docker command/function.TypesCurrently two types of workflows are supported:ExecutionMetaflow: exections defined as metaflow flowspecsDeploymentYaml: deployment defined as yamlsExecutionMetaflowAdditional fields for aExecutionMetaflowentry arepy: path to the python file containing themetaflow.FlowSpecclassclassName: name of themetaflow.FlowSpecclassadditionalOptions(optional): The section is identical to theadditionalOptionsfrom the workflow configs.train-workflow:description:>Description text [optional]dockerfile:cpu:train/Dockerfilecpu:train/DockerfileGPUtype:ExecutionMetaflowpy:train/flow.pyclassName:TrainingFlowadditionalOptions:annotations:artifacts.ai.sap.com/datain.kind:datasetartifacts.ai.sap.com/trainedmodel.kind:modellabels:...workflow:# list of strings passed as workflow options...metaflow:# list of strings passed as metaflow options (only valid for ExecutionMetaflow)---package-suffixes=.py,.shDeploymentYamlAdditional fields:yaml: contains a path to a Deployment Template.my_deployment:type:DeploymentYamlyaml:deploy/template.yamldockerfile:deploy/DockerfileA Deployment Template is a regular Serving Template. Data fromname,annotationsandlabelsfields from a user-defined
workflow config would replace correspondent attributes in the template.
In addition, variables$imageand$imagePullSecretwill be replaced with the values from the workflow config.apiVersion:ai.sap.com/v1alpha1kind:ServingTemplatemetadata:name:my-servingannotations:executables.ai.sap.com/name:my-servingexecutables.ai.sap.com/description:"Mymodelserving"labels:ai.sap.com/version:"0.0.1"spec:template:apiVersion:serving.kserve.io/v1beta1metadata:labels:|ai.sap.com/resourcePlan: "infer.s"spec:|predictor:imagePullSecrets:- name: $imagePullSecretcontainers:- name: kserve-containerimage: $imageContentPackagefrom yamlThe specification of a content package and of the workflows can also be merged into a single yaml file:name:test-spec-yamlexamples:examplesdescription:|this is a test.show_files:test:SHOW_FILEworkflows:test_execution:type:ExecutionMetaflowclassName:TestPipelinepy:train/flow.pydockerfile:cpu:train/Dockerfilegpu:train/DockerfileGPUannotations:artifacts.ai.sap.com/datain.kind:datasetartifacts.ai.sap.com/trainedmodel.kind:modelmetaflow:---package-suffixes=.py,.sCurrently there is no discovery mechanism for yaml specs.They either have to be consumed in python:fromai_core_sdk.contentimportContentPackagecontent_package=ContentPackage.from_yaml(spec_yaml)or made available to the CLI through theaicore-content -c <path to the spec yaml> ...option or through theAI_CORE_CONTENT_SPECSenvironment variable.Embedded code packagesMetaflow supports the Data Scientist during the experimentation phase, such that it packs all python files into an archive called "code package" and stores it in the configured S3 bucket. Later, during steps execution, this code package is downloaded into the docker container, unpacked there and the respective step function from the Metaflow python file is executed. This approach helps to iterate faster since there is no need to rebuild the docker image after every code change.In production, however the ML code will not change often. Therefore, it could be preferable to pack the code into the docker image instead of injecting it for every run. In other words, we want to embed the ML code into the docker image.When runningaicore-content create-image ..., a code package is always generated and placed next to the corresponding Dockerfile under the namecodepkg.tgz. This file could be used in the Dockerfile with:ADD codepkg.tgz .In addition, it is necessary to to tell sap-ai-core-metaflow to use the embedded coded package instead of downloading it.
Add this to the workflow's config file:additionalOptions:
workflow:
- --embeddedTrackingThe tracking module of the SAP AI Core SDK can be used to log metrics in both your local environment, and productive workflow executions. Metrics persistence is currently available in your productive environment.Here are a few code samples demonstrating how to use the SDK for metrics tracking.Modify Metricsfrom ai_core_sdk.tracking import Tracking
from ai_core_sdk.models import Metric, MetricTag, MetricCustomInfo
tracking_client = Tracking()
tracking_client.modify(
tags = [
# list
MetricTag(name="Our Team Tag", value="Tutorial Team"),
MetricTag(name="Stage", value="Development")
],
metrics = [
Metric(
name="Training Loss",
value=np.finfo(np.float64).max,
timestamp= datetime.now().utcnow(),
step = 1, # denotes epoch 1
labels = []
)
],
custom_info = [
# list of Custom Information
MetricCustomInfo(
name = "My Classification Report",
# you may convert anything to string and store it
value = str('''{
"Cats": {
"Precision": 75,
"Recall": 74
},
"Dogs": {
"Precision": 85,
"Recall": 84
}
}''')
)
]
)Log Metricstracking_client.log_metrics(
metrics = [
Metric(
name="Training Loss",
value=float(86.99),
timestamp= datetime.now().utcnow(),
step = 1, # denotes epoch 1
labels = []
),
],
)Set Tagstracking_client.set_tags(
tags = [
# list
MetricTag(name="Our Team Tag", value="Tutorial Team"),
MetricTag(name="Stage", value="Development")
]
)Set Custom Infotracking_client.set_custom_info(
custom_info = [
# list of Custom Information
MetricCustomInfo(
name = "My Classification Report",
# you may convert anything to string and store it
value = str('''
{
"Cats": {
"Precision": 75,
"Recall": 74
},
"Dogs": {
"Precision": 85,
"Recall": 84
}
}
'''
)
),
]
)Query Metricsmetrics_response = tracking_client.query(execution_ids = [
"test_execution_id" # Change this with the training execution id
])Delete Metricsmetrics_response = tracking_client.delete(execution_id = "test_execution_id") # Change this with the actual execution id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.