Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create gpt_perspectives.py #1673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Raiff1982
Copy link

Allows the models to answer questions in a more exact way with less propblems and new answers.

Summary

Briefly describe the changes and the goal of this PR. Make sure the PR title summarizes the changes effectively.

Motivation

Why are these changes necessary? How do they improve the cookbook?

---they will give modles more creativity

For new content

When contributing new content, read through our contribution guidelines, and mark the following action items as completed:

  • I have added a new entry in registry.yaml (and, optionally, in authors.yaml) so that my content renders on the cookbook website.
  • [x ] I have conducted a self-review of my content based on the contribution guidelines:
    • [x ] Relevance: This content is related to building with OpenAI technologies and is useful to others.
    • [x ] Uniqueness: I have searched for related examples in the OpenAI Cookbook, and verified that my content offers new insights or unique information compared to existing documentation.
    • [ x] Spelling and Grammar: I have checked for spelling or grammatical mistakes.
    • [ x] Clarity: I have done a final read-through and verified that my submission is well-organized and easy to understand.
    • [x ] Correctness: The information I include is correct and all of my code executes successfully.
    • [x ] Completeness: I have explained everything fully, including all necessary references and citations.

We will rate each of these areas on a scale from 1 to 4, and will only accept contributions that score 3 or higher on all areas. Refer to our contribution guidelines for more details.

Allows the models to answer questions in a more exact way with less propblems and new answers.
@Raiff1982 Raiff1982 marked this pull request as ready for review February 7, 2025 06:21
@Raiff1982
Copy link
Author

This code defines multiple classes, each representing a different "perspective" for generating responses to questions. Each class has a generate_response method that returns a response based on its unique perspective. Here are some key points about the code:

NewtonPerspective: Calculates a "thought force" based on the length of the question.
DaVinciPerspective: Provides a creative and artistic view of the question.
HumanIntuitionPerspective: Focuses on emotional and intuitive responses.
NeuralNetworkPerspective: Uses terms associated with neural networks and machine learning.
QuantumComputingPerspective: Utilizes quantum computing concepts.
ResilientKindnessPerspective: Emphasizes growth and compassion through challenges.
MathematicalPerspective: Applies mathematical principles to the question.
PhilosophicalPerspective: Examines the question through various philosophical lenses.
CopilotPerspective: Offers structured and collaborative approaches to problem-solving.
BiasMitigationPerspective: Suggests methods to reduce bias in AI models.
PsychologicalPerspective: Analyzes the question from psychological viewpoints.
Each class uses the random.choice function to select a response from a predefined list, making the responses varied and dynamic. The design allows for easy extension by adding more perspectives or modifying existing ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant