Skip to content

‐ 1.6.0 OpenAI Custom GPT Configuration

bsc7080gbc edited this page Dec 27, 2024 · 2 revisions

Creating a custom GPT involves defining a virtual assistant’s behavior, personality, and operational framework through a thoughtfully designed prompt and supporting configuration files. This process allows you to craft a highly personalized and functional AI assistant tailored to your unique needs. It does require you to have access to a ChatGPT+ account.

Configuration Essentials

  1. Foundation of the Prompt:

    • The provided prompt defines your assistant’s purpose, operational parameters, and interaction style.
    • It serves as the core of your assistant’s personality, providing clear guidance on how it should respond and perform tasks.
  2. Supporting Files:

    • core.json:
      • This file establishes immutable rules, commands, and automations that govern the assistant’s behavior.
      • It ensures consistency, reliability, and adherence to predefined system workflows.
    • ziggyprompt.md:
      • Acts as a complement to the core configuration, defining the assistant’s tone, personality, and overarching purpose. This is the same prompt that you will configure your Custom GPT with. This just ensures that it is part of the knowledge to further place the personality and function as a fixture within your Custom GPT’s “behavior”.
    • Optional autobiography.txt:
      • Provides an opportunity to infuse depth and character into your assistant.
      • This faux autobiography creates a unique persona, enhancing user engagement with a relatable and memorable conversational style.
      • Tools like ChatGPT can assist in crafting this file, aligning it with your vision for the assistant.
    • Optional personality files:
      • Consider create different personality files, e.g. defaultmode.txt, precisemode.txt, etc.
      • You can use AI to help generate the personality files, create as many as you wish so you can swap them out on the fly
      • Attach to your Custom GPT as training files. During runtime when you need Ziggy to operate in precision mode, just say:
        switchmode precisemode.txt and load
        
        Your AI Assistant should collect the file from knowledge and infuse it into your current session.
      • You can create instructions at the top of the personality files instructing it to adopt the personality file as an override to the core defaults.
      • You can disable the personality mode simply by statinug:
        disable switchmode return to core defaults
        
  3. Custom Naming:

    • You can rename your virtual assistant to reflect its purpose or personality. The chosen name will align with the Custom GPT and appear consistently throughout interactions.

Initializing Your Custom GPT

To enable your Custom GPT, include a command like "/initialize". This command:

  • Loads the assistant and imports knowledge from the prompt.
  • Pulls in the ziggyprompt.md file, core.json file, and the optional autobiography.txt.
  • Supports adding additional knowledge files for an expanded understanding and capabilities.

Capabilities of the Custom GPT

When configuring your assistant, enable the following capabilities for maximum functionality:

  • Web Search: Access real-time data from the web to enhance responses and provide up-to-date information.
  • DALL-E Image Generation: Generate images based on descriptive prompts for a more creative and visual experience.
  • Code Interpreter & Data Analysis: Handle coding tasks, analyze datasets, and provide computational support.

Integrating with GitHub

To streamline operations, we use the private GitHub repository (e.g., "MyShelf") that we created earlier to manage workflows and files securely. Make sure you have already created your private github repository. Use the provided schema or build your own custom API integration:

  • Update {owner} in the schema with your GitHub username.
  • The repository must remain private to protect sensitive data.

Key Features:

  • Manage files like data.json for dynamic updates.
  • Automate workflows using GitHub Actions to enhance efficiency.
  • Ensure secure and controlled access to your assistant’s operational framework.

By combining the structured prompt with supporting configuration files (core.json, ziggyprompt.md, and optional files like autobiography.txt), you can create a unique and highly functional Custom GPT. With secure integrations, robust capabilities, and a tailored persona, your virtual assistant becomes a powerful tool to support your tasks and interactions.

GitHub Repository Contents API: schema

This API schema provides an interface to manage files and workflows within a GitHub repository. It supports operations such as retrieving, updating, uploading, deleting files, and triggering GitHub Actions workflows. Designed with flexibility in mind, it uses OpenAPI 3.1.0 standards and integrates seamlessly with repositories for automated or manual file and workflow management.

Note: If you need assistance with assembly of the schema, I found the ActionsGPT from OpenAI very useful https://chatgpt.com/g/g-TYEliDU6A-actionsgpt


Overview

  • Title: GitHub Repository Contents API
  • Version: 2.0.0
  • Purpose: To facilitate interaction with GitHub repositories for file operations and workflow triggers.
  • Server: https://api.github.com
    • All requests are directed to the GitHub API, ensuring reliable access to repository resources.

Supported Endpoints

1. File Management: /repos/{owner}/MyShelf/contents/{path}

This path supports three operations: retrieving, uploading or updating, and deleting files in a GitHub repository.

a. Retrieve File
  • HTTP Method: GET
  • Operation ID: getFile
  • Summary: Fetches the contents of a specific file from the repository.
  • Parameters:
    • Path (path): The full path to the file (e.g., data.json or updates/data.json).
    • Accept Header: Specifies the API version (application/vnd.github+json).
  • Response:
    • 200: Returns the file metadata, including:
      • File type, encoding, size, content, and SHA.
b. Upload or Update File
  • HTTP Method: PUT
  • Operation ID: uploadOrUpdateFile
  • Summary: Uploads a new file or updates an existing one.
  • Parameters:
    • Path (path): The full path to the file.
  • Request Body:
    • Includes:
      • Commit Message: A message describing the change.
      • Committer Info: Name and email of the committer.
      • Content: Base64-encoded file content.
      • SHA: The current file’s SHA (if updating an existing file).
  • Response:
    • 201: Confirms the file was successfully uploaded or updated, returning:
      • File details (name, path).
      • Commit metadata (SHA, message, author).
c. Delete File
  • HTTP Method: DELETE
  • Operation ID: deleteFile
  • Summary: Deletes a specified file from the repository.
  • Parameters:
    • Path (path): The full path to the file.
  • Request Body:
    • Includes:
      • Commit Message: A message explaining the deletion.
      • Committer Info: Name and email of the committer.
      • SHA: The SHA of the file being deleted.
  • Response:
    • 200: Confirms the file deletion, returning:
      • Commit metadata (SHA, message, author).

2. Workflow Management: /repos/{owner}/MyShelf/actions/workflows/{workflow_id}/dispatches

This endpoint allows triggering GitHub Actions workflows programmatically.

Trigger Workflow Dispatch
  • HTTP Method: POST
  • Operation ID: triggerWorkflowDispatch
  • Summary: Initiates a workflow dispatch event.
  • Parameters:
    • Owner (owner): The repository owner.
    • Repository (repo): The repository name, e.g. MyShelf
    • Workflow ID (workflow_id): The specific workflow file or ID to trigger.
  • Request Body:
    • Includes:
      • Ref: The Git reference (branch or commit SHA) on which to run the workflow.
  • Response:
    • 204: Confirms successful dispatch of the workflow event.

Key Features

  1. Flexibility:

    • Provides granular control over repository contents and workflows.
    • Supports dynamic file paths and repository owners for multi-repository use.
  2. Rich Metadata:

    • Returns detailed file and commit metadata, aiding in version control and auditing.
  3. Workflow Automation:

    • Simplifies triggering and managing GitHub Actions workflows directly via the API.
  4. Standards Compliance:

    • Adheres to OpenAPI 3.1.0 for compatibility with modern tooling and API ecosystems.

Usage Scenarios

  1. File Management:

    • Retrieve: Use GET to fetch configuration files like core.json or dynamic data like data.json.
    • Update: Use PUT to upload updated content for workflows or scripts.
    • Delete: Use DELETE to clean up outdated or unused files.
  2. Workflow Triggers:

    • Trigger CI/CD pipelines or automated processes by dispatching GitHub workflows programmatically.

Implementation Notes

  1. Authentication:

    • Requires an authenticated API token with appropriate permissions for repository content and workflows.
    • Use headers to include the Accept version for compatibility.
  2. Placeholders:

    • {owner} and {repo} are placeholders for the repository’s owner and name, allowing customization for different projects.
  3. Error Handling:

    • Ensure accurate file paths and SHA values to prevent errors during file updates or deletions.

Example Request

Retrieve File:

GET /repos/example-owner/MyShelf/contents/data.json Accept: application/vnd.github+json

Response:

{
  "type": "file",
  "encoding": "base64",
  "size": 1234,
  "content": "base64encodedcontent",
  "sha": "abcdef123456"
}
Clone this wiki locally