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

[Question] How can I get in my agent the user code or at least the file reference (file path and line numbers) ? #3

Open
eylonmalin opened this issue Nov 20, 2024 · 1 comment
Labels
question Further information is requested

Comments

@eylonmalin
Copy link

Question
How can I get in my agent the user code or at least the file reference (file path and line numbers) ?

Context
I want to get the user context in my agent

Additional context
I'm building a new agent and need the user context

@eylonmalin eylonmalin added the question Further information is requested label Nov 20, 2024
@Houndie
Copy link

Houndie commented Nov 21, 2024

Hi @eylonmalin!

I'm not 100% sure on your question, so I might be answering something you're not asking.

If you're talking about getting information about the current user, you can use the value in the X-GITHUB-TOKEN header to make calls against GitHub's API on behalf of the user.

If you're talking about "what is the user currently doing" (for example what repositories do they have open), you can find that information in the request body, messages[*].copilot_references. Note that what references get sent are client-dependent!

Let me know if this answers your question.

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

No branches or pull requests

2 participants