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

Anthropic Examples/Readme Guide Created and Proper Reference Noted. #466

Merged
merged 19 commits into from
Nov 9, 2024

Conversation

TKTSWalker
Copy link
Contributor

📥 Pull Request

📘 Description
_Changed link on Anthropic example to an anthropic readme I created; aside from the pre existing barebones example, I also included three examples showing how the async, sync and tool function could be used.

The sync example shows a case where a sentence generated by simple mixing and connecting is given as context to create a story. The async example has the LLM generate a script line based off the game "TitanFall", depending on the state of the Titan and the personality. At the same time, 4 UUIDs are generated on async as a simple example. Finally, the tool function gives a piece of "Cyberware" based off the user's requested company. Then with the job role the user wants, the LLM says if it is a good or bad fit.

I purposefully made the examples connect to different media as when starting out, lesser experienced developers often have issues following along without a greater level of explanation and focus is an issue as well. By connecting it to better known medias, it remains more engaging while allowing the reader to possibly create parallels between the instructions being shown and the base concepts they're already aware of.

I am also requesting that I am allowed to use AgentOps to show how to do a few things such as setting up a history to keeping it small but with context through summarization when needed. Then, a few use case examples could be shown to help newer developers both understand how to develop with LLMs and how to do so with AgentOps!_

🧪 Testing
Ran journals on Kaggle piece by piece (Which is why the async example is changed so much aside from having a little more meaningful example) before sending it over to a friend to test as well.

Contains 3 journals showcasing sync/async using anthropic and a tool example!
This example uses async in a little more meaningful way while also taking care of a few fixes and errors!
Finalized page and made clearer! Also fixed a number of issues within the async function example.
Changed Anthropic example link to point to the guide readme
@areibman
Copy link
Contributor

areibman commented Nov 5, 2024

Let's take a look @the-praxs

@the-praxs the-praxs self-requested a review November 6, 2024 20:29
@the-praxs the-praxs linked an issue Nov 6, 2024 that may be closed by this pull request
3 tasks
@areibman
Copy link
Contributor

areibman commented Nov 9, 2024

Thanks @TKTSWalker! The sync notebook looks great but it looks like you're using Anthropic Computer Use in the others, and those don't work. Is that what you're after? Or did you just coincidentally name the roles "computer"

@TKTSWalker
Copy link
Contributor Author

Good afternoon! I named the role computer by coincidence, the name should be able to be replaced with a term like "Machine" if need be! i'm just used to naming the role computer, as with the way the system works, the output shouldn't be affected!

If there are any problems with this however, please feel free to let me know and I will act accordingly!

@areibman
Copy link
Contributor

areibman commented Nov 9, 2024

Good afternoon! I named the role computer by coincidence, the name should be able to be replaced with a term like "Machine" if need be! i'm just used to naming the role computer, as with the way the system works, the output shouldn't be affected!

If there are any problems with this however, please feel free to let me know and I will act accordingly!

Hahaha that's what I figured. Can you make the changes and re-run the notebooks end-to-end to make sure they run properly? Will merge ASAP when you push it

@TKTSWalker
Copy link
Contributor Author

TKTSWalker commented Nov 9, 2024 via email

Copy link

Files selected (22)
  • README.md
    - agentops/init.py
    - agentops/client.py
    - agentops/helpers.py
    - agentops/host_env.py
    - agentops/llms/init.py
    - agentops/llms/ai21.py
    - agentops/llms/mistral.py
    - agentops/session.py
    - docs/snippets/github-stars.mdx
    - docs/v1/integrations/ai21.mdx
    - docs/v1/integrations/langchain.mdx
    - docs/v1/introduction.mdx
    - docs/v1/quickstart.mdx
    - docs/v1/scripts/entelligence.js
    - docs/v1/styles/styles.css
    - examples/ai21_examples/ai21_examples.ipynb
    - examples/mistral_examples/mistral_example.ipynb
    - pyproject.toml
    - tests/core_manual_tests/providers/ai21_canary.py
    - tests/core_manual_tests/providers/anthropic_canary.py
    - tests/core_manual_tests/providers/mistral_canary.py
Files ignored (18)
  • docs/images/external/app_screenshots/chat-viewer.png
    - docs/images/external/app_screenshots/dashboard-banner.png
    - docs/images/external/app_screenshots/dashboard_banner.png
    - docs/images/external/app_screenshots/overview-charts.png
    - docs/images/external/app_screenshots/overview.png
    - docs/images/external/app_screenshots/session-drilldown-graphs.png
    - docs/images/external/app_screenshots/session-drilldown-metadata.png
    - docs/images/external/app_screenshots/session-overview.png
    - docs/images/external/app_screenshots/session-replay.png
    - tests/test_agent.py
    - tests/test_canary.py
    - tests/test_events.py
    - tests/test_pre_init.py
    - tests/test_record_action.py
    - tests/test_record_tool.py
    - tests/test_session.py
    - tests/test_teardown.py
    - tox.ini
Instructions

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:

    @Entelligence.AI + *your message*

    • Example: @Entelligence.AI Can you suggest improvements for this code?
  • Execute a command using the format:

    @Entelligence.AI + *"/command"*

Available Commands:

  • /updateCommit: Apply the suggested changes and commit them.
  • /updateGuideline: Modify an existing guideline.
  • /addGuideline: Introduce a new guideline.

Tips for Using @Entelligence.AI Effectively:

  • Specific Queries: For the best results, be specific with your requests. Example: @Entelligence.AI summarize the changes in this PR.
  • Focused Discussions: Tag @Entelligence.AI directly on specific code lines or files for detailed feedback.
  • Managing Reviews: Use review comments for targeted discussions on code snippets, and PR comments for broader queries about the entire PR.

Need More Help?

  • Visit our documentation for detailed guides on using Entelligence.AI.
  • Join our community to connect with others, request features, and share feedback.
  • Follow us for updates on new features and improvements.

@TKTSWalker
Copy link
Contributor Author

Whoops, found my errors! I was thinking about raw text input/output like the Llama.cpp instead of accounting for the fact that anthropic deadlocks assistant and user!

Also there are one or two errors but the reason it may not have worked on your end aside from roles is the fact that I was supposed to put client = Anthropic(api_key=ANTHROPIC_API_KEY) but accidently removed everything in the ()!

Fixing now and I already got sync working again, it should take a few minutes at least and an hour or two at most (considering I don't get sidetracked)!
image_2024-11-09_105434685

Copy link

Files selected (1)
  • pyproject.toml
Files ignored (0)
Instructions

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:

    @Entelligence.AI + *your message*

    • Example: @Entelligence.AI Can you suggest improvements for this code?
  • Execute a command using the format:

    @Entelligence.AI + *"/command"*

Available Commands:

  • /updateCommit: Apply the suggested changes and commit them.
  • /updateGuideline: Modify an existing guideline.
  • /addGuideline: Introduce a new guideline.

Tips for Using @Entelligence.AI Effectively:

  • Specific Queries: For the best results, be specific with your requests. Example: @Entelligence.AI summarize the changes in this PR.
  • Focused Discussions: Tag @Entelligence.AI directly on specific code lines or files for detailed feedback.
  • Managing Reviews: Use review comments for targeted discussions on code snippets, and PR comments for broader queries about the entire PR.

Need More Help?

  • Visit our documentation for detailed guides on using Entelligence.AI.
  • Join our community to connect with others, request features, and share feedback.
  • Follow us for updates on new features and improvements.

I made a few fixes which I forgot to account for during development, for example 

- Accidently using the "computer role" when only "assistant" and "user" role is allowed
- Making several major changes for readability
- Keeping output strings to show that the scripts work properly and
- Properly starting an AgentOps session which properly logs everything
@TKTSWalker
Copy link
Contributor Author

Hello @areibman it's all set! I had to handle a few things related to revamping as I realized I made some glaring mistakes that barely kept things working! You can check

https://github.com/TKTSWalker/agentops/blob/main/examples/anthropic_examples/anthropic-example-sync.ipynb
https://github.com/TKTSWalker/agentops/blob/main/examples/anthropic_examples/anthropic-example-async.ipynb
https://github.com/TKTSWalker/agentops/blob/main/examples/anthropic_examples/antrophic-example-tool.ipynb

to see that these were ran and the outputs are still there to view to confirm as working!

Besides that, I do believe that the way listed for the tool functions do not work in the default example and want to handle this but it will take a while to properly implement it! For example, I had problems while keeping stream on! Also, the output itself is also not a string but rather a sort of weirdish output (kind of similar to Json)!

Even if there is a way to get things from text, the JSON format is extremely valuable as it allows for easily getting the AI's text and related tools!

I am completely sure that I can make a system around automatically handling this but it would definitely take a little time and direct focus so i'm hoping to do so in a different push request entirely!

Copy link

Files selected (2)
  • README.md
    - docs/v1/integrations/anthropic.mdx
Files ignored (0)
Instructions

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:

    @Entelligence.AI + *your message*

    • Example: @Entelligence.AI Can you suggest improvements for this code?
  • Execute a command using the format:

    @Entelligence.AI + *"/command"*

Available Commands:

  • /updateCommit: Apply the suggested changes and commit them.
  • /updateGuideline: Modify an existing guideline.
  • /addGuideline: Introduce a new guideline.

Tips for Using @Entelligence.AI Effectively:

  • Specific Queries: For the best results, be specific with your requests. Example: @Entelligence.AI summarize the changes in this PR.
  • Focused Discussions: Tag @Entelligence.AI directly on specific code lines or files for detailed feedback.
  • Managing Reviews: Use review comments for targeted discussions on code snippets, and PR comments for broader queries about the entire PR.

Need More Help?

  • Visit our documentation for detailed guides on using Entelligence.AI.
  • Join our community to connect with others, request features, and share feedback.
  • Follow us for updates on new features and improvements.

Copy link

Files selected (0)
Files ignored (1)
  • docs/mint.json
Instructions

Emoji Descriptions:

  • ⚠️ Potential Issue - May require further investigation.
  • 🔒 Security Vulnerability - Fix to ensure system safety.
  • 💻 Code Improvement - Suggestions to enhance code quality.
  • 🔨 Refactor Suggestion - Recommendations for restructuring code.
  • ℹ️ Others - General comments and information.

Interact with the Bot:

  • Send a message or request using the format:

    @Entelligence.AI + *your message*

    • Example: @Entelligence.AI Can you suggest improvements for this code?
  • Execute a command using the format:

    @Entelligence.AI + *"/command"*

Available Commands:

  • /updateCommit: Apply the suggested changes and commit them.
  • /updateGuideline: Modify an existing guideline.
  • /addGuideline: Introduce a new guideline.

Tips for Using @Entelligence.AI Effectively:

  • Specific Queries: For the best results, be specific with your requests. Example: @Entelligence.AI summarize the changes in this PR.
  • Focused Discussions: Tag @Entelligence.AI directly on specific code lines or files for detailed feedback.
  • Managing Reviews: Use review comments for targeted discussions on code snippets, and PR comments for broader queries about the entire PR.

Need More Help?

  • Visit our documentation for detailed guides on using Entelligence.AI.
  • Join our community to connect with others, request features, and share feedback.
  • Follow us for updates on new features and improvements.

@areibman areibman self-requested a review November 9, 2024 22:37
@areibman areibman merged commit 84a94dd into AgentOps-AI:main Nov 9, 2024
2 of 3 checks passed
@areibman
Copy link
Contributor

areibman commented Nov 9, 2024

Merged-- thanks @TKTSWalker !!

@TKTSWalker
Copy link
Contributor Author

Hey, no problem! Moving onto the next!

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.

[Docs]: Anthropic support docs
3 participants